Jesse Williams
Jesse Williams

Reputation: 140

How to access the Maximo list where clause programmatically

In the WOTRACK app of Maximo, I need to find some way to programmatically access the where clause of the current window query. It's clear this exists somewhere in Maximo, since you can access it in the UI under Advanced Search > Where Clause. I need to find some way to get this info programmatically and pass it on to an application I am working with.

In the past I've hacked together a way of grabbing this data by having the user open the where clause window in Maximo, and then just retrieving the value of the textarea element containing the where clause. I'm hoping to find some way to access it through Maximo's Java classes, so the user doesn't have to open that window. I've dug through Maximo's Javadocs and I can see there is a WhereClauseTextArea class which I believe would be responsible for creating the text area. I would like to be able to pass the UI session ID to Maximo's Java classes and get back the current where clause for the list. Is there a simple way of doing this? I would like to be able to use JavaScript to access this from the front end, or Java to access it from the back end of Maximo, or an automation script as a last resort.

Upvotes: 4

Views: 6199

Answers (2)

User1974
User1974

Reputation: 386

In Maximo 7.6.1.1/Jython, we can use the getWebClientSession() method:

wclause = service.webclientsession().getCurrentApp().getResultsBean().getMboSet().getUserAndQbeWhere() 

service.error("The WHERE clause is : ", wclause);

Upvotes: 6

Preacher
Preacher

Reputation: 2145

Maximo has a number of different where clause sources (app restrictions, object restrictions, relationships, QBE (Query By Example) filters, site restrictions, and more). With an Automation Script (Python or JavaScript), you should be able to snag what you're looking for from mbo.getThisMboSet().getUserWhere() or .getUserAndQbeWhere() or .getWhere(). As a commenter pointed out, .getCompleteWhere() may also be helpful.

You can find the JavaDocs on those psdi.mbo.MboSet methods, or find other "where clause getting" methods, here.

Upvotes: 3

Related Questions