Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access the Maximo list where clause programmatically

Tags:

maximo

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.

like image 697
Jesse Williams Avatar asked Jan 27 '23 04:01

Jesse Williams


2 Answers

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);
  • At the time that this was written, the getWebClientSession() method wasn't included in the docs (because the docs were for version 7609).

  • Credit goes to AndreasBr on DeveloperWorks for finding the original answer: Sending "dialogok" from Automationscript | get WebClientSession in Jython.

like image 121
User1974 Avatar answered Jun 14 '23 04:06

User1974


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.

like image 20
Preacher Avatar answered Jun 14 '23 03:06

Preacher