Skip to main contentIBM Maximo REST API Guide

Child objects

This section explains how to filter, sort or limit (paging) child data sets while being inlined within their parent data set. All the query parameters for the child object collection operations follow a naming pattern that is <mbo name>.<relation name>.<operator>. The MBO name token refers to the parent MBO name for the child MboSet. The relation name is the relation name from the parent MBO to the child MboSet. The operator determines the type of inline operation that you are trying to apply on the child collection.

The following are the types of query parameters that are available:

Where Filter

The format of this query parameter is <mbo_name>.<relation_name>.where. This query sets the WHERE clause filter for the child object that is identified by the mbo_name parent MBO and the relation_name relation name. The syntax for the WHERE clause follows the oslc.where format with the target MboSet in context. For example, to filter on the polines in the MXPO object structure, use the follow format:

GET /oslc/os/mxapipo?oslc.select=ponum,status,poline{polinenum,itemnum,linec ost}&po.poline.where=itemnum="*" and linecost>100.0

The poline’s that have an itemnum and line cost that is greater than 100 is shown and does not impact the selection of the PO records.

To support the or clause on the where clause (instead of the default and clause), the query parameter <mbo name>.<relation name>.opmodeor which if set to 1, treats the where clause specified above as an or clause. This results in fetching all lines that have either a itemnum or a linecost that is greater than 100.

Timeline queries

The format for these query parameters are <mbo_name>.<relation_name>.tlrange for the time line range (eg -3M or +2Y) and <mbo_name>.<relation_name>.tlattribute (the attribute name of the child object on which to base the time-line on) following in the lines of the Timeline queries.

These query child object filters examines and limits the child objects in the inlined with the root object of the object structure. If you need to show those child objects in a list or tabular form and then page through and filter them, then you can use the relation name in the URI to traverse to that set. By traversing to the set, you can operate on the child collection independently and be able to page the collection.

Sorting

The format of this query parameter is <mbo_name>.<relation_name>.orderBy. This query sorts the child collection, follows the oslc.orderBy format, and is applied to the context of the child collection.

GET /oslc/os/mxapipo?oslc.select=ponum,status,poline{polinenum,itemnum,linecost}&po.poline.orderBy=-linecost&lean=1

The results shows a descending sort list on the linecost for the poline collection.

Paging - Limit Filter

The format for this query parameter is <mbo_name>.<relation_name>.limit. This query sets the limit to the number of rows to be retrieved for the child collection.

GET /oslc/os/mxpo?oslc.select=ponum,status,poline{polinenum,itemnum,linecost}&po.poline.limit=1&lean=1

The results show the limit the number of polines loaded to only 1 for each purchase order in the response.