I tried a similar example in my environment by duplicating the MXDOMAIN object structure and adding in WORKORDER as a child object of MAXDOMAIN with a custom relationship (EMXWORKORDER) with a where clause of 1=1 (so would return all work orders).
I then executed a GET request like:
/maximo/oslc/os/emxdomain?lean=1&oslc.select=domainid,workorder{wonum,description,estlabcost,estmatcost}&oslc.where=domainid="WOSTATUS"&maxdomain.emxworkorder.where=wonum="1022"
This filtered my WO data to just a single WO for performance reasons but the data came back as I would expect:
"member": [
{
"_rowstamp": "19957174",
"workorder_collectionref": "http://mx7vm/maximo/oslc/os/emxdomain/_V09TVEFUVVM-/emxworkorder",
"href": "http://mx7vm/maximo/oslc/os/emxdomain/_V09TVEFUVVM-",
"workorder": [
{
"_rowstamp": "59668801",
"localref": "http://mx7vm/maximo/oslc/os/emxdomain/_V09TVEFUVVM-/emxworkorder/0-202",
"description": "Electric Cart Tune-Up test",
"estmatcost": 24.68,
"href": "http://childkey#TUFYRE9NQUlOL1dPUktPUkRFUi9CRURGT1JELzEwMjI-",
"estlabcost": 18.5,
"wonum": "1022"
}
],
"domainid": "WOSTATUS"
}
]
I also tried what would happen if it wasn't part of the object structure (just retrieved utilizing the rel.emxworkorder) and that worked as expected as well.
I can't think of how Maximo wouldn't understand the data type for a particular field because it's a child of another object. The only thing I could think of is there is some manipulation of the data (such as an automation script) and that is calling the wrong method to retrieve the value. Is it possible you have an OSOUT automation script on the object structure in question?
------------------------------
Steven Shull
IBM
------------------------------
Original Message:
Sent: 09-06-2022 11:58
From: Prashant Bavane
Subject: REST get call not fetching decimal data correctly ...its retrieving in integer value only
Hi Steven.
Thanks for your response.
Yes when create Object Structure just on custom table it returns data properly.
We have set up this custom object structure with maxdomain and then child as we have custom UI outside maximo which load these domain data by further filtering and logic using oslc query clause , scripts etc.
------------------------------
Prashant B
Original Message:
Sent: 09-06-2022 11:26
From: Steven Shull
Subject: REST get call not fetching decimal data correctly ...its retrieving in integer value only
Just to confirm my understanding... you have a custom object that you're loading records into as part of an object structure that contains MAXDOMAIN as the parent object and goes from MAXDOMAIN->CUSTOMTABLE in the object structure. Your records are loading into Maximo correctly (IE the value in the database is 25.5) but when you then retrieve the records utilizing the same object structure via the REST API it's being returned as 25 instead of 25.5. Is that correct?
What happens if you have an object structure against just your custom object? Since this is a table domain (not an ALNDOMAIN), having MAXDOMAIN as the parent object doesn't make sense. When loading records, you typically want an object structure that is representative of how you would modify the records in Maximo. ALNDOMAIN requires an owner of MAXDOMAIN because that's how it works in the UI. In your case of a custom object, your custom object should be fine as the main object. Whether the custom object is used in a table domain or not, the logic there is the same so there is no need to link back to the MAXDOMAIN record.
------------------------------
Steven Shull
IBM
Original Message:
Sent: 09-06-2022 09:44
From: Prashant Bavane
Subject: REST get call not fetching decimal data correctly ...its retrieving in integer value only
Created custom table with few columns with decimal (5,2).
Created table domain using this table with list where 1=1.
Created Object structure having this parent object as maxdomain and custom table in step1 as child ( with relationship).
When we load the domain data via rest get request data is not giving decimal values correctly 25.5 is returned as 25.
can anyone faced similar issue or do know what should be causing this ?
#Integrations
------------------------------
PDB
------------------------------