↓ Skip to main content
A gouache painting of a closed teal door in an off-white wall. On the doormat in front of the door lies one orange envelope.

Wrong Belief: A Refused Datasource Gets an Empty Answer

A tester sends you a screenshot: the list is empty, “No results found”. You check the where clause, the saved query and the demo data. Everything is right, and the list stays empty for this one user. The answer was on the wire the whole time. Maximo had refused the read, and it had said so in plain words.

MAS 9.2 series wrong beliefs

This is a single belief from the series that starts with Ten Things Every Maximo Developer Believes That Are Wrong. We measured it on our test system, on the MAS 9.2 series, in the browser preview of our Components Explorer.

The belief
#

“The list is empty, so Maximo sent an empty answer. When a user has no access, Maximo returns no rows.”

The belief comes from the screen. An empty list looks the same in every case, and the app is what a developer looks at first.

What we measured
#

Our page has two datasources with the same markup, each bound to a list. The first reads work orders through mxapiwodetail. The second reads through an object structure that Maximo refuses for the user of our preview.

The structure the user may readThe structure Maximo refuses
Requestsentsent
HTTP status200400
Bodymember with the rowsError with a code and a message
Hooks of the datasourceonBeforeLoadData, onAfterLoadDataonBeforeLoadData, onLoadDataFailed
On the pagethree rowsa system message, then “No results found”
state.hasDatatruetrue
state.itemCount30

The request went out in both cases. For the refused structure, Maximo answered with this body, shortened here by a link and a timestamp:

{
  "Error": {
    "reasonCode": "BMXAA9301E",
    "message": "BMXAA9301E - The user of the transaction is not authorized for Object Structure MXAPIASSETSTATUS. Configure authorization in the object structure application and grant necessary access to the user.",
    "statusCode": "400"
  }
}

A query that finds nothing looks different on the wire. We asked the first structure for a work order that does not exist. Maximo answered with HTTP 200 and an empty member list.

Three screens of the lab page. First, a system message: the user of the transaction is not authorized for Object Structure MXAPIASSETSTATUS, with the code BMXAA9301E. Second, the page after the message is closed: the first list has three work orders, 1000, 1001 and 1002, and the second list reads “No results found”, with hasData = true and rows = 0 above it. Third, the same page after the button for state.error: the line “Last call” now holds the message with the code BMXAA9301E.
The message, the page after it is closed, and the error that the datasource keeps

The message appears once
#

The framework did show the error. A system message opened over the page, with the text of Maximo and the code. That is more than the belief expects.

The trap comes one click later. The user closes the message, and the page keeps no sign of it. The list reads “No results found”. The datasource says hasData = true and zero rows, the same as after a query that found nothing. A screenshot taken at this moment shows an empty list and nothing else.

A second load repeats the story. We called forceReload() on the refused datasource. The request went out again, the answer was 400 again, and the message opened again. The call itself did not throw.

Where the error stays
#

The datasource keeps the error in its state. Our page reads it in the page controller. The lines are shortened here:

const e = ds.state.error;
if (!e) return 'state.error is empty';
return `state.error: ${e.message}`;

For the refused datasource it returned the full message with the code. The hook onLoadDataFailed of the datasource controller ran on both refused loads. A controller can use that moment, for example to set a state that the page shows.

Two codes for a refused read
#

We saw two codes on our system, on two object structures:

CodeWhat the message says
BMXAA9301Ethe user is not authorized for the object structure
BMXAA0024Ethe action READ is not allowed on the object

The second one met us when we opened a whole app that no group had access to. AIPAPP: Asset Investment Planning in Maximo Manage tells that story.

Check it yourself
#

  1. Sign in as the user with the empty list, and open the network tab of the browser.
  2. Open the page, and filter the requests for /os/.
  3. Look at the status of each request. A 400 has the reason in its body.

It works without the app too. Call the address of the object structure in the browser while you are signed in, or with the API key of the user, and read what comes back.

The model that holds
#

We measured three causes of an empty list, and each one leaves a different trace:

CauseRequestAnswerhasDatastate.error
The datasource never loadednonenonefalseempty
The query found nothingsent200, no rowstrueempty
Maximo refused the readsent400, a messagetruethe message

The first cause is the first belief of the overview article. For the other two, the screen shows the same thing. The network tab of the browser tells them apart.

What to read next#

Loading and Displaying Data shows when a datasource sends its first request. The Datasource Cheatsheet lists the states and the hooks on one page.


IBM describes the authorization of object structures in the documentation of Maximo Manage, in the Object Structures and Security Groups applications. The error format of the REST API is part of IBM’s documentation of the Maximo REST API.