Maximo Open Forum

 View Only

 Automation Script issue when manipulating dialog

  • Customizations
  • Maximo Application Suite
Axel Alamilla's profile image
Axel Alamilla posted 03-12-2025 18:36

Hi everyone,

I'm currently developing an Automation Script (AS) on MAS 9 for a client that allows users to select multiple PR lines from a dialog and create one or more POs, depending on whether the PRs have the same vendor. I've already created the dialog, and I'm trying to close it using the service.closeDialog() function within the script. However, the button that triggers the action inside the dialog appears disabled. I’ve already configured it and granted access to the sign option, but it seems I'm missing something.

The following is the dialog code. In the event of the first button, I set the name of the sign option, which is the same as in the action launch point.

<dialog beanclass="psdi.webclient.system.beans.MultiselectDataBean" id="copyprlnpo" label="Copy PR Line Items To PO"> 
		<table id="copyprlnpo_table" label="PR Line Items" selectmode="multiple" mboname="PR" whereclause="status='APROB'">
			<tablebody displayrowsperpage="20" filterable="true" filterexpanded="true" id="copyprlnpo_tablebody" inputmode="readonly">
				<tablecol filterable="false" hidden="false" id="copyprlnpo_table_tablebody_1" mxevent="toggleselectrow" sortable="false" type="event"/>
				<tablecol dataattribute="PRNUM" id="copyprlnpo_table_tablebody_2"/>
				<tablecol dataattribute="VENDOR" id="copyprlnpo_table_tablebody_3"/>
				<tablecol dataattribute="PRLINE.ITEMNUM" id="copyprlnpo_table_tablebody_4"/>
				<tablecol dataattribute="PRLINE.DESCRIPTION" id="copyprlnpo_table_tablebody_5"/>
				<tablecol dataattribute="PRLINE.ORDERQTY" id="copyprlnpo_table_tablebody_6"/>
				<tablecol dataattribute="PRLINE.REFWO" id="copyprlnpo_table_tablebody_7"/>
				<tablecol dataattribute="PRLINE.COMMODITYGROUP" id="copyprlnpo_table_tablebody_8"/>
				<tablecol dataattribute="PRLINE.COMMODITY" id="copyprlnpo_table_tablebody_9"/>
				<tablecol dataattribute="PRLINE.REQUESTEDBY" id="copyprlnpo_table_tablebody_10"/>
				<tablecol dataattribute="PRLINE.REQDELIVERYDATE" id="copyprlnpo_table_tablebody_11"/>
				<tablecol dataattribute="PRLINE.CONSIGNMENT" id="copyprlnpo_table_tablebody_12"/>
				<tablecol dataattribute="PRLINE.SITEID" id="copyprlnpo_table_tablebody_13"/>
			</tablebody>
		</table>
		<buttongroup id="copyprlnpo_2">
			<pushbutton default="true" id="copyprlnpo_2_1" label="Select Items" mxevent="tcopyprlnpo"/>
			<pushbutton id="copyprlnpo_2_2" label="Cancel" mxevent="dialogcancel"/>
		</buttongroup>
	</dialog>

This dialog is called from an action in the PR app menu

This is also linked to a sign option:

But as shown above, the button seems to be disabled and does nothing.

The configuration of the sign option for the action event is the following

The user is granted for both sign options

As I mentioned before, I'm looking for at least to be able to close the dialog from the AS, so I'm using the following code

session=service.webclientsession()
databean=session.getDataBean("copyprlnpo_table")
if databean:
    prlineSet=databean.getMboSet()
    selectedRecords=prlineSet.getSelection()
    if selectedRecords:
        iterator=selectedRecords.iterator()
        while iterator.hasNext():
            prlineMbo=iterator.next()
    service.closeDialog()

So, does anyone have an idea of what I am doing wrong? 

mark robbins's profile image
mark robbins

Have you confirmed which parts of this code is being executed? 

Perhaps add in logger statements to confirm the value of the the data bean variable

Have you checked the logs for any errors /warnings when the dialog is displayed ? 

Are there any relevant messages in the browser console tab? 

session=service.webclientsession()
databean=session.getDataBean("copyprlnpo_table")
if databean:
    prlineSet=databean.getMboSet()
    selectedRecords=prlineSet.getSelection()
    if selectedRecords:
        iterator=selectedRecords.iterator()
        while iterator.hasNext():
            prlineMbo=iterator.next()
    service.closeDialog()
Axel Alamilla's profile image
Axel Alamilla

@mark robbins Well, I tried to print in the log the value of the variables and something random, but I only get the following messages in the log:

14 Mar 2025 15:09:21:620 [INFO] [MXServer] [] BMXAA6721I - Bind value for SOURCE = session=service.webclientsession()
databean=session.getDataBean("copyprlnintopo_table")
service.log(str(session))
service.log(str(databean))
service.log("Inicia el script de copy de prlines...")
if databean: 
    service.closeDialog()

And

14 Mar 2025 15:09:21:639 [DEBUG] [MXServer] [] done loading launch point TCOPYPRLNPO for script TCOPYPRLNPO
14 Mar 2025 15:09:21:640 [DEBUG] [MXServer] [] done loading script TCOPYPRLNPO
[err] java.lang.NullPointerException
[err] 	at psdi.mbo.SqlFormat.setObject(SqlFormat.java:582)
[err] 	at psdi.mbo.SqlFormat.setObject(SqlFormat.java:557)
[err] 	at psdi.app.inventory.InventoryService.getItemSetIdFromSite(InventoryService.java:291)
[err] 	at psdi.app.inventory.InventoryService.createIssue(InventoryService.java:228)
[err] 	at psdi.iface.app.isu.MaxISUProcess.createMboSet(MaxISUProcess.java:214)
[err] 	at psdi.iface.mos.MosProcessImpl.processMboSet(MosProcessImpl.java:1850)
[err] 	at psdi.iface.mos.MosProcessImpl.setMainMaximoTable(MosProcessImpl.java:1044)
[err] 	at psdi.iface.mos.MosProcessImpl.fillMaximoTables(MosProcessImpl.java:808)
[err] 	at psdi.iface.mos.MosProcessImpl.processExternalData(MosProcessImpl.java:346)
[err] 	at psdi.iface.mos.MosProcessImpl.processObjectStructureService(MosProcessImpl.java:241)
[err] 	at psdi.iface.mic.MicService.processObjectStructureData(MicService.java:937)
[err] 	at psdi.iface.mic.MicService.processOSLCAsJSON(MicService.java:638)
[err] 	at com.ibm.tivoli.maximo.oslc.provider.OSPOSTRouteHandler.handleRequest(OSPOSTRouteHandler.java:914)
[err] 	at com.ibm.tivoli.maximo.oslc.provider.MaximoOslcProviderServlet.handleRoute(MaximoOslcProviderServlet.java:1378)
[err] 	at com.ibm.tivoli.maximo.oslc.provider.MaximoOslcProviderServlet.processPostPut(MaximoOslcProviderServlet.java:1491)
[err] 	at com.ibm.tivoli.maximo.oslc.provider.MaximoOslcProviderServlet.doPost(MaximoOslcProviderServlet.java:267)
[err] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:706)
[err] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
[err] 	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1266)
[err] 	at [internal classes]
[err] 	at com.ibm.tivoli.maximo.filter.UnSupportedMethodBlockFilter.doFilter(UnSupportedMethodBlockFilter.java:60)
[err] 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
[err] 	at [internal classes]
[err] 	at psdi.webclient.system.filter.HttpXFrameOptionsFilter.doFilter(HttpXFrameOptionsFilter.java:43)
[err] 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
[err] 	at [internal classes]
[err] 	at psdi.webclient.system.filter.MTContextFilter.doFilter(MTContextFilter.java:53)
[err] 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
[err] 	at [internal classes]
[err] 	at psdi.webclient.system.filter.XAccessTokenFilter.doFilter(XAccessTokenFilter.java:146)
[err] 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
[err] 	at [internal classes]
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[err] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[err] 	at java.base/java.lang.Thread.run(Thread.java:839)

Note: I simplified the code to close the dialog, but it is still not working, as shown.

Axel Alamilla's profile image
Axel Alamilla

I also get this in the log

[3/14/25, 20:00:23:048 GMT] 00000f31 SystemOut                                                    O 14 Mar 2025 20:00:23:048 [INFO] [MXServer] [] BMXAA6721I - Bind value for CHANGEBY = MAXADMIN
[3/14/25, 20:00:23:050 GMT] 00000f31 SystemOut                                                    O 14 Mar 2025 20:00:23:048 [DEBUG] [MXServer] [] Generated exception
psdi.util.MXSystemException: BMXAA6721I - Bind value for SOURCE = #-------------------------------------------------------------
#-------------------------------------------------------------
session=service.webclientsession()
databean=session.getDataBean("copyprlnpo_table")
service.log("Inicia el script de copy de prlines...")
service.log(str(session))
service.log(str(databean))
	at psdi.mbo.MboSet.logBindValue(MboSet.java:10522) [businessobjects.jar:?]
	at psdi.mbo.MboSet.setBindValueAsClob(MboSet.java:10127) [businessobjects.jar:?]
	at psdi.mbo.MboSet.setBindValue(MboSet.java:9746) [businessobjects.jar:?]
	at psdi.mbo.MboSet.setBindValuesForUpdate(MboSet.java:9572) [businessobjects.jar:?]
	at psdi.mbo.MboSet.updateMbo(MboSet.java:9428) [businessobjects.jar:?]
	at psdi.mbo.MboSet.saveTransaction(MboSet.java:7927) [businessobjects.jar:?]
	at psdi.txn.MXTransactionImpl.saveTransaction(MXTransactionImpl.java:221) [businessobjects.jar:?]
	at psdi.txn.MXTransactionImpl.save(MXTransactionImpl.java:156) [businessobjects.jar:?]
	at psdi.mbo.MboSet.save(MboSet.java:7724) [businessobjects.jar:?]
	at psdi.mbo.MboSet.save(MboSet.java:7648) [businessobjects.jar:?]
	at psdi.webclient.system.beans.AppBean.save(AppBean.java:656) [maximouiweb.war:?]
	at psdi.webclient.system.beans.AppBean.SAVE(AppBean.java:1241) [maximouiweb.war:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:572) ~[?:?]
	at psdi.webclient.system.session.WebClientSession.defaultHandler(WebClientSession.java:1444) [maximouiweb.war:?]
	at psdi.webclient.system.session.WebClientSession.handleEvent(WebClientSession.java:1317) [maximouiweb.war:?]
	at psdi.webclient.system.session.WebClientSession.processRequestEvent(WebClientSession.java:5580) [maximouiweb.war:?]
	at psdi.webclient.system.session.WebClientSession.handleClientSideQueueRequest(WebClientSession.java:5538) [maximouiweb.war:?]
	at psdi.webclient.system.session.WebClientSession.handleRequest(WebClientSession.java:867) [maximouiweb.war:?]
	at psdi.webclient.system.session.AsyncRequestManager.handleRequest(AsyncRequestManager.java:555) [maximouiweb.war:?]
	at psdi.webclient.system.session.AsyncRequestManager.manageRequest(AsyncRequestManager.java:253) [maximouiweb.war:?]
	at psdi.webclient.system.controller.RequestManager.manageRequest(RequestManager.java:317) [maximouiweb.war:?]
	at psdi.webclient.servlet.WebClientServlet.handleRequest(WebClientServlet.java:141) [maximouiweb.war:?]
	at psdi.webclient.servlet.WebClientServlet.doPost(WebClientServlet.java:52) [maximouiweb.war:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:706) [com.ibm.websphere.javaee.servlet.4.0_1.0.93.jar:?]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:791) [com.ibm.websphere.javaee.servlet.4.0_1.0.93.jar:?]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1266) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:754) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:451) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:197) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:100) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at io.openliberty.http.monitor.ServletFilter.doFilter(ServletFilter.java:75) [io.openliberty.http.monitor_1.0.93.jar:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.HttpCrossSiteScriptingSecurity.doFilter(HttpCrossSiteScriptingSecurity.java:66) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.MXCorrelationFilter.doFilter(MXCorrelationFilter.java:137) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.PerformanceMonitor.doFilter(PerformanceMonitor.java:126) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.tivoli.maximo.filter.UnSupportedMethodBlockFilter.doFilter(UnSupportedMethodBlockFilter.java:60) [commonweb.jar:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.HttpXFrameOptionsFilter.doFilter(HttpXFrameOptionsFilter.java:43) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.MTContextFilter.doFilter(MTContextFilter.java:53) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at psdi.webclient.system.filter.XAccessTokenFilter.doFilter(XAccessTokenFilter.java:146) [maximouiweb.war:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.security.jaspi.JaspiServletFilter.doFilter(JaspiServletFilter.java:58) [com.ibm.ws.security.jaspic.1.1_1.0.93.jar:?]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:1069) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1260) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1078) [com.ibm.ws.webcontainer_1.1.93.jar:?]
	at com.ibm.ws.webcontainer.servlet.Ca
mark robbins's profile image
mark robbins

your log files are providing useful information....

This null pointer error in the [err] stream is potentially quite important although I can't tell if it is from the UI code or from an external interface.

You would need to reconfigure your server to provide some extra information - read the full post for instructions about how to reconfigure this.

Lets assume that the error is relevant.

The error is telling us that Maximo received a request (possibly from one of the new Graphite based applications) and that the InventoryService is trying to issue items.
It is calling the psdi.app.inventory.InventoryService.getItemSetIdFromSite method which is then trying to build a SQL statement to be executed. Presumably the SQL relies on the Site being populated to help determine the ItemSetId

The SqlFormat class is unable to build the SQL statement because an object is null.
So the code needs to be checked to ensure that all the appropriate data is provided


[err] java.lang.NullPointerException [err] at psdi.mbo.SqlFormat.setObject(SqlFormat.java:582) [err] at psdi.mbo.SqlFormat.setObject(SqlFormat.java:557)
[err] at psdi.app.inventory.InventoryService.getItemSetIdFromSite(InventoryService.java:291) [err] at psdi.app.inventory.InventoryService.createIssue(InventoryService.java:228) [err] at psdi.iface.app.isu.MaxISUProcess.createMboSet(MaxISUProcess.java:214) [err] at psdi.iface.mos.MosProcessImpl.processMboSet(MosProcessImpl.java:1850) [err] at psdi.iface.mos.MosProcessImpl.setMainMaximoTable(MosProcessImpl.java:1044) [err] at psdi.iface.mos.MosProcessImpl.fillMaximoTables(MosProcessImpl.java:808) [err] at psdi.iface.mos.MosProcessImpl.processExternalData(MosProcessImpl.java:346) [err] at psdi.iface.mos.MosProcessImpl.processObjectStructureService(MosProcessImpl.java:241) [err] at psdi.iface.mic.MicService.processObjectStructureData(MicService.java:937) [err] at psdi.iface.mic.MicService.processOSLCAsJSON(MicService.java:638) [err] at com.ibm.tivoli.maximo.oslc.provider.OSPOSTRouteHandler.handleRequest(OSPOSTRouteHandler.java:914) [err] at com.ibm.tivoli.maximo.oslc.provider.MaximoOslcProviderServlet.handleRoute(MaximoOslcProviderServlet.java:1378) [err] at com.ibm.tivoli.maximo.oslc.provider.MaximoOslcProviderServlet.processPostPut(MaximoOslcProviderServlet.java:1491) [err] at

I can't be sure if the err entry is related to your automation script error because there are no time/thread details.

Adding the following configuration will change the MAS configuration so that the WebSphere logger records the date/time/thread for all entries regardless of the source. Then you need to check the threadid in the revised log entries to see if the log entries were generated by the same thread and in the same time period

It is important to configure WebSphere so it can provide the most information for support staff.
Several sections require the POD to be stopped and a new POD started. All the settings can be applied in one operation with a single restart at the end of the configuration work – there is no need to restart the PODs after each change.

The key change here for your system are the references to "tbasic" as these will provide extra information.

1.    Log in to MAS Suite Administration
2.    Go To Workspaces, select Manage
3.    From the Actions menu, select Update configuration
4.    Click on the edit button next to Server Bundles
5.    For each of the bundles:
a.    Click on the “View” link in column Additional properties
b.    In the box “Additional server config”, paste the following xml:
<?xml version='1.0' encoding='UTF-8'?>
<server>
    <logging logDirectory="/logs" messageFileName="${env.HOSTNAME}_messages.log" maxFileSize="5" maxFiles="10" traceFormat="tbasic" consoleFormat="tbasic" messageFormat="tbasic" />
</server>
~                  
c.    Click Save
6.    Scroll to the top of the page and lick Apply Changes. This starts Activation of the Manage app and eventually restarts all Manage pods.

mark robbins's profile image
mark robbins

This looks like a SQL debug message. I suspect that your SQL logger is set to DEBUG and that means that it is recording the values of the fields when the records are being saved.

so this is recording that you have saved an automation script and that the source attribute was set to the text that you can see.

so it is useful to see that information but it is not relevant to the problem.

14 Mar 2025 15:09:21:620 [INFO] [MXServer] [] BMXAA6721I - Bind value for SOURCE = session=service.webclientsession()
databean=session.getDataBean("copyprlnintopo_table")
service.log(str(session))
service.log(str(databean))
service.log("Inicia el script de copy de prlines...")
if databean: 
    service.closeDialog()