How to import attachments into MAXIMO using MIF
PedroHFaria 310001NAMA Comments (3) Visits (9521)
In this blog I will explain the most common option to upload attachments into Maximo 7.6.
First thing to check is if your Maximo environment is setup to use attachments. If you have further questions about it, please check the technote below “How to set up attached documents with Websphere Application Server”:
How to upload file using MIF (Maximo Integration Framework)?
There are several ways to import data into Maximo, REST, Web Services, Flat files, etc.
I will be using a Web Service in this example, but the Object Structure/Metadata will be the same for every possibility.
You have two scenarios:
select parent from maxrelationship where child = 'DOCLINKS';
In this example I am using SR(Service Request) table with DOCLINKS as below:
Observation: You can also create an Enterprise Service, but in this example we will use only Object Structure.
I am not going to enter in every detail of Web Service creation. You just need to create and deploy Web Service. You can do that using Web Services Library application.
You can use any tool to submit XML into Web Service. I usually use SoapUI, it’s simple and easy to use.
The XML below is just a sample having the required attributes.
DOCUMENTDATA: This is the file by itself. But the file must be encoded in base64.
OWNERID: This is a required field, but in this case is not necessary because the relationship will fill in the value for you. But if you create an Object Structure with DOCLINKS only, you must send this value. DOCLINKS table will always have an owner table. OWNERID is the ID of the owner table, for example, if the owner table is WORKORDER owner ID is WORKORDERID.
URLNAME: Maximo will not create the file in the repository with the name sent (testfile01.txt). To avoid duplicity Maximo will merge that name with an ID. In this example the file created was test
URLNAME: Upper case/Lower case matters for this scenario. Be sure that you are sending in the same format that your server. In this scenario Maximo will not change the name of the file (testPF.txt) you must guarantee the uniqueness of the file name in the desired folder.
DOCUMENTDATA: We are not sending this field because we are not uploading the file in this scenario.
UPLOAD: We changed the value of this field to 0 to indicate that we are not uploading the file.
Stay tuned for more.