MAS 9.2 series comparison
This post builds on Datasource Basics, which explains what a datasource is and names the three kinds. Here we compare the two you use every day. We ran every call on our test system, on the MAS 9.2 series, on a page of our Components Explorer, a small Maximo Mobile app we built for these articles.
The same list, twice#
The first datasource reads the work orders of one site from Maximo:
<maximo-datasource id="fs_d_kinds_mx" object-structure="mxapiwodetail"
where="siteid="BEDFORD"" order-by="wonum" page-size="5" selection-mode="none">
<schema id="fs_d_kinds_mx_s">
<attribute name="wonum" unique-id="true" id="fs_d_kinds_mx_a_wonum"/>
<attribute name="description" searchable="true" id="fs_d_kinds_mx_a_description"/>
<attribute name="status" id="fs_d_kinds_mx_a_status"/>
<attribute name="wopriority" id="fs_d_kinds_mx_a_wopriority"/>
</schema>
</maximo-datasource>The second one reads ten demo work orders from a file of the app:
<json-datasource id="fs_d_kinds_js" src="fs-workorders.js" id-attribute="_id"
pre-load="true" page-size="5" selection-mode="none">
<schema id="fs_d_kinds_js_s">
<attribute id="fs_d_kinds_js_a_wonum" name="wonum" type="STRING" unique-id="true"/>
<attribute id="fs_d_kinds_js_a_description" name="description" type="STRING" searchable="true"/>
<attribute id="fs_d_kinds_js_a_status" name="status" type="STRING"/>
<attribute id="fs_d_kinds_js_a_wopriority" name="wopriority" type="NUMBER"/>
</schema>
</json-datasource>The file exports an array of plain objects, one per row. Two of the ten rows, shortened here:
const workorders = [
{_id: 1, wonum: 'WO-1001', description: 'Replace pump seal', status: 'WAPPR', wopriority: 1},
{_id: 2, wonum: 'WO-1002', description: 'Monthly compressor check', status: 'APPR', wopriority: 3}
];
export default workorders;Three things differ in the declaration:
maximo-datasource | json-datasource | |
|---|---|---|
| Where the rows come from | object-structure, with where and order-by | src, a file of the app |
| The key of a row | the attribute with unique-id | id-attribute names a property of the row |
| The type of an attribute | our schema names none | type on each attribute |
Everything that reads the rows is the same for both. A data-list names the datasource, and a label binds to {item.wonum}. The page shows one list under the other:

What each one sends#
When the page opens, the Maximo datasource sends one request. We read it in the browser:
GET …/oslc/os/mxapiwodetail
oslc.select=wonum,description,status,wopriority
oslc.where=siteid="BEDFORD"
oslc.orderBy=+wonum
oslc.pageSize=10
collectioncount=1Each part comes from the declaration. The select is the schema, and the where clause and the order are the attributes of the same name. The answer said that 1,483 work orders match, and on a phone the list drew the first five. The request asks for ten rows, and the datasource says five. Pagination and Performance explains that.
The JSON datasource sent nothing. Its ten rows travel inside the app, and the list drew five of them, because page-size counts for both kinds.
Then we ran the same seven calls on each datasource and counted the requests:
| Call | maximo-datasource | json-datasource |
|---|---|---|
| the page opens | 1 request, 5 rows of 1,483 | 0 requests, 5 rows of 10 |
search("pump") | 1 request with oslc.searchTerms=pump, 46 work orders | 0 requests, 3 rows |
search("") | 1 request, 1,483 again | 0 requests, 10 again |
a filter on status = APPR | 1 request, the where clause gains and status="APPR", 318 work orders | 0 requests, 3 rows |
| change the priority of the first row | 0 requests | 0 requests |
save() | 1 request to the record | 0 requests |
forceReload() | 1 request | 0 requests |
Search and filters work on both#
The controller code is the same for both kinds. One method of our page takes the id of a datasource and runs the call on it:
const ds = this.page.findDatasource(id);
await ds.search('pump');
ds.setQBE('status', '=', 'APPR');
await ds.searchQBE();The place where the work happens differs. Maximo searched all 1,483 work orders of the site and returned the 46 that match. The JSON datasource searched its ten rows in the memory of the app and kept three. Both looked into the attributes the schema marks with searchable="true".
So a JSON datasource is a full datasource for a list: it pages, it searches, it filters, and a data-list with a search box works on it. Search and Filtering goes through these calls one by one.
Saving is where the two part#
We changed the priority of the first row in both lists and called save().
On the Maximo datasource the change set the state itemsChanged to true and sent nothing. The save sent one request to the record. After it, a read through the API showed the new priority on the server, changed by the user of our API key.
On the JSON datasource the change set itemsChanged too. The save sent nothing and reported no error. The new value stayed in the memory of the app: a forceReload() kept it, and a reload of the app in the browser brought back the value of the file.
A JSON datasource therefore holds a change only while the app runs. Data that a user expects to find again tomorrow, or that a colleague has to see, belongs in a Maximo datasource.
What the editor shows#
Our MAF editor lists the live datasources of a page in its Data tab. For this page it shows the difference in two entries. The Maximo datasource comes with its query and the request it sent. The JSON one comes with a line that says it reads no object structure.

Which one to use#
| You need | Use |
|---|---|
| records of Maximo: work orders, assets, locations | maximo-datasource |
| data the user changes and expects to keep | maximo-datasource |
| a short fixed list: the choices of a filter, the entries of a menu | json-datasource with a file |
| rows that your code builds at runtime | json-datasource, filled by a controller |
| a page that has to draw without any server, for a demo or a test | json-datasource with a file |
The fourth row is a common pattern in the apps IBM ships: a JSON datasource starts with an empty array as its source, src="{[]}", and a controller fills it, for example with the markers of a map.
The third kind, the datasource with an adapter of your own, is for data from a system other than Maximo. Datasource Basics introduces it.
What to read next#
Loading and Displaying Data shows when a datasource sends its first request, and which datasources of a page send none. The cookbook recipe Add a Field shows what the schema does to the request, one attribute at a time.
IBM’s own reference for <maximo-datasource> and <json-datasource> ships with every MAS install. In the Application Configuration application, open the ? menu and choose Component Documentation.
