Syed Umar AnisMaximo EAMMaximo: Launching and closing dialog through Automation Script
Syed Umar AnisMaximo EAMMaximo: Launching and closing dialog through Automation Script

Launching a dialog

Following code launches the status dialog. Any dialog Id can be specified from the application’s XML.

from psdi.server import MXServer
from psdi.common.context import UIContext
from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent

mxServer = MXServer.getMXServer()
context = UIContext.getCurrentContext()
if context:
  wcs = context.getWebClientSession()
  Utility().sendEvent(WebClientEvent("status", wcs.getCurrentPageId(), None, SessionContext(wcs)))

Closing a dialog

Method # 1: The following code closes the currently open dialog by sending a dialogok event.

from psdi.common.context import UIContext
from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent

context = UIContext.getCurrentContext()
if context:
   wcs = context.getWebClientSession()
   Utility().sendEvent(WebClientEvent("dialogok", wcs.getCurrentPageId(), None, SessionContext(wcs)))

Method # 2: In newer versions of Maximo, the above can be achieved with a single line.

service is an implicit variable provided by the framework.

service.closeDialog()
Hi, I’m Umar

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *