MxLoader 7.1 and above supports the new Maximo JSON APIs that are available from Maximo 7.6.0.2. The REST APIs are based on the OSLC protocol so there are some changes you have to consider. The most important difference between OS and REST service is the format of the where clause that can be set in cell D1 of MxLoader sheets.
While OS server accepts SQL syntax, the REST service follows the OSLC specifications. In this post I will describe the most important concept to write OSLC where clauses.
Operators
Supported operators are:
- = equal
- != not equal
- < less than
- > greater than
- <= less than or equal
- >= greater than or equal
Like
Support for like is done using the = operator and providing a partial value with the ‘%’.
Examples:
- locations beginning with ABC: location=”ABC%”
- locations ending with ABC: location=”%ABC”
- locations containing ABC: location=”%ABC%”
IN
Support for IN will let you compare a value to a list and meet the condition when the value exists in the list.
Example:
- assets having the asset number 1001 or 1002: assetnum in [“1001″,”1002”]
Null
A where clause can check a field for a value of null or if the field is not null.
- Description has null value: description!=”*”
- Description is not null: description=”*”
Dates
Dates are expressed in ISO 8601 format that is YYYY-MM-DDTHH:MM:SS-TZ
Example:
- Assets modified after a certain date: changedate>”2021-04-07T09:50:00-04:00″
Hi Bruno
My question relates to REST Vs OS Integration Services for MX Loader. We are using SAML authentication and API keys. So the MX Loader Config needs to use REST and not OS. However, from our testing, the REST API does not call the related Object Structure Outbound Processing Automation Script. Is this as Maximo bug or as designed? I can see any documentation relating to any differences between API and OS integration architecture.
Thanks
¿How can you use the order by parameter in a query with the REST API?
Hi,
Write in E1 the parameter that will order the query like:
+reportdate
I was using MXAPIPERSON objectstructure and attempting to get one where the person.supervisor field is not null but person.supervisor=”*” nor person.supervisor!=”*” is working out for me.
You need to drop the person. as this is the primary table
PersonID in [“TEST1″,”TEST2″,”TEST3″] and Supervisor!=”*”
Not sure in which contexts which syntaxes apply in Maximo rest OS and OSLC end points. Noted for the maxrest/rest/os context recently that = isn’t = rather it’s like. =~eq~ or _exactmatch = 1 required to get =.
Who thought that was a good idea?
See this page.
https://www.ibm.com/docs/en/control-desk/7.6.1.2?topic=method-query-parameters-operators
I’m in mam 7613
Hello Bruno,
I’m trying to narrow down the results in my query for the child records. I want to add another filter like this:
“classstructure.classspec.where=assetattrid=”xxxx””
I tried to put it in cell F1, and it appends it at the end, but the first = equal sign is escaped and hence being ignored by Maximo. Is there a way that I can make this work by escaping the escaping of the = so it gets passed through.
Hello Bruno,
What is an “agile evangelist” ? (1 Peter 3:15)
Thank you,
Michael
How can you do a subquery in an OSLC formatted query? e.g., I want to query open (APPR) purchase orders that have receipts complete but are not order unit “SV”.
I tried:
receipts=”COMPLETE” and status=”APPR” and ponum in [select poline.ponum from poline where poline.siteid=po.siteid and poline.orderunit=”SV”]
This results in a error of:
Encountered ” “select “” at line 1, column 53.
Was expecting:
…
I tried it with parentheses instead of square brackets and it also didn’t like that either
update I found a way to get this particular item resovled via the object structure, instead of a subquery I used:
receipts=”COMPLETE” and status=”APPR” and po.poline.orderunit=”SV”
I would still like to be able to do a more complex subquery, but for now I can use, modifying if need be, object structures to get what I need.
just quick note in case anyone else encounters this:
In the example in the original post, e.g.
changedate>”2021-04-07T09:50:00-04:00″
the double quotes got converted to “smart quotes”. So if you literally copy/paste from there to try stuff out, they will throw an error unless you convert them back to normal quotes.