Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Fri May 07, 2021 10:17 PM
    Edited by System Admin Wed March 22, 2023 11:51 AM

    In a previous post, @Steven Shull mentioned that there is a new​ Java method in 7.6.1.2:  (source: New java classes & methods in 7.6.1.2?)

    service.launchDialog(String dialogId)

    Does anyone have any further information about that new method?

    What kinds of dialogs can it open? Where are the dialogs stored?

    Thanks



    Related:

    Maximo: Launching and closing dialog through Automation Script
    https://umaranis.com/2021/08/22/maximo-launching-and-closing-dialog-through-automation-script/?unapproved=33652&moderation-hash=c773165a65e27c429dd966e0e505ee3a#comment-33652


    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Sat May 08, 2021 04:31 PM
    Edited by System Admin Wed March 22, 2023 11:48 AM

    From a colleague:

    This new method launchDialog(dialogId) has been added to ScriptService class.
    It can be used to open the application dialogs (existing or custom), which are defined in application xml.
    It takes dialog id as a parameter.

    1. Create a Object launch point automation script WO_TEST as below. Event Save->Add/update.

    from psdi.common.context import UIContext
    from psdi.webclient.system.session import WebClientSessionManager
    from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
    from java.lang.System import out
    
    out.println("start of script WO_TEST**************")
    
    c = UIContext.getCurrentContext().getWebClientSession()
    dialogId = "status"
    out.println("script WO_TEST**************"+dialog)
    service.launchDialog(dialogId)
    out.println("script WO_TEST**********after launchdialog**********")
    


    2. Goto Work Order Tracking application and update any record, click save. System will open dialog 'Change Status' (dialogId passed as status).

    This method can be used in script whenever we need to open pop-up dialog to the user after performing some logic.
    Dialogs can also be opened without this method by using below code:

    Utility().sendEvent(WebClientEvent("status", c.getCurrentPageId(), None, SessionContext(c)))

    #AssetandFacilitiesManagement
    #Maximo


  • 3.  RE: Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Sun May 09, 2021 04:23 PM
    Adding a bit to this response.

    The service functionality around UI requires firing as an ACTION launch point (push button, select action, etc.). MBO level launch points (such as object save, attribute action/validate, etc.) don't typically interact with the UI. This is because the MBO represents the business logic and the bean classes represent the presentation layer. I tested and could not get the service.launchDialog to work on object save. But their option 2 did work, even from MBO launch points. I must admit this was new to me so I appreciate the tip.

    I would always write logic to ensure it's interactive and in the app where you expect it to be though, otherwise REST API requests (including from mobile products like Anywhere) or updates caused by background processes are going to fail because they aren't interactive and you're trying to invoke UI functionality. On something like WO, you could be interactive and modifying it from the PM, Labor Reporting, Receiving, Inventory, etc. apps which wouldn't function as intended. 

    The dialog can be a dialog inside the app XML as mentioned. But Maximo also supports dialogs in other areas such as the LIBRARY XML. If you have a common dialog that you want to display in multiple apps you should put it in the LIBRARY XML and not specific applications. For example, there are various areas inside of Maximo that utilize the Expression Builder. Instead of building the dialog in each app, IBM puts it in the LIBRARY XML which is looked at after checking inside of the app. This allows it to function consistently in each app.

    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    ------------------------------



  • 4.  RE: Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Wed July 28, 2021 12:03 AM

    Thanks for the info Steven. Very helpful.

    A question about "I tested and could not get the service.launchDialog to work on object save":
    Would you consider that to be a bug that IBM might want to know about/fix?

    Thanks.




  • 5.  RE: Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Thu July 29, 2021 08:18 AM

    Getting an APAR for automation script issues can be difficult (though this being with the ScriptService is advantageous) as most things would be considered an enhancement. I believe the intended use case was only to support this on UI events, of which the only launch point would be action, and it works there. Whether it should work on a MBO method is up to interpretation. There's no harm in asking (I've opened cases like this before) , I just don't want to set unrealistic expectations and I know that opening cases takes time so it comes down to effort. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 6.  RE: Info about service.launchDialog(String dialogId)? (new in 7.6.1.2)

    Posted Wed November 03, 2021 09:50 AM