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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With