Maximo

Maximo

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

 View Only
  • 1.  Synonym Status won't display Change Status dialogue from Common Actions

    Posted Mon March 14, 2022 12:34 PM
    Hello,
    We're implementing a new WCLOSE status (synonym of COMPLETE) for WOs. Our users will choose this status instead of fully closing the WO. (system will automatically close the WO through an escalation)

    I'd like to maintain the user's ability to move a WO to this new status from the "Common Actions" menu (like they have with "Close Work Order" now).

    I've got that option showing up in Common Actions, but clicking it doesn't do anything. (doesn't open the Change Status dialog with "WCLOSE" selected, as hoped).

    Is the above possible?

    Below are the pieces of the puzzle I have so far.

    Thanks for any assistance you can provide.

    • Action to change WO status to WCLOSE


    • Added WCLOSE sig option in App Designer for WOTRACK

    • Added WCLOSE option to Toolbar Menu in App Designer for WOTRACK (and hid the existing CLOSE option)


    • "Set WO Waiting to CLOSE" appears in Common Actions in WOTRACK, but doesn't do anything when clicked









    ------------------------------
    Ryan C.
    ------------------------------

    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Tue March 15, 2022 09:42 AM
    On your signature option, did you expand the Advanced Signature Options and choose "This is an action that must be invoked by the user in the UI"? That is required when our action is an automation script for example. I've never tried tying it to a standard action but I assume it would cause the action to fire.

    That being said, I don't think this would function as you intend. That change status action is used by workflow & escalations to change the status silently. The other status actions actually bring up the dialog for the user to record a memo and be able to cancel (in case they accidentally select it). I think you would have to do this as an ACTION launch point automation script that loads the dialog (either list_status or status depending on if you're on the list tab) and then sets the status in the dialog. Since you're on at least 7.6.1.X based on the UI you would be able to do this.

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



  • 3.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Mon March 21, 2022 11:03 AM
    Hi Steven,
    Yes, I was hoping the action would load the Change Status dialog with the WCLOSE status set. Thanks for the suggestion of an ACTION launch point automation script that loads the dialog.

    I've got the automation script hooked up to the Common Action. It launches the Change Status dialog successfully... I just need to figure out how to set the status to "WCLOSE" in the dialog. Struggling with that one a bit... looking for a "set" something, but not having much luck.


    I've also got a little hiccup where if I click the action > cancel the dialog > click the action again,  I get some weird "invalid binding" stuff happening.



    Automation script:

    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)))​



    ------------------------------
    Ryan Coghlin
    ------------------------------



  • 4.  RE: Synonym Status won't display Change Status dialogue from Common Actions
    Best Answer

    Posted Mon March 21, 2022 02:47 PM
    Trying to mimic what we do in the StatefulAppBean, you want something like below (replacing the maxvalue & value settings with your desired choices). This helps ensure some checks occur such as the record is in a state where the status change is allowed and that the user has the permission prior to loading the dialog. It requires no imports.

    I'm seeing the same issue you reported (hitting cancel and then opening it again gets invalid binding error) but haven't had time to look into it. 

    maxvalue="APPR"
    value="SCHEDASSIGN"
    session=service.webclientsession()
    dialogid="status"
    if session.getCurrentApp().onListTab():
        dialogid="list_status"
    
    appBean=session.getCurrentApp().getAppBean()
    statefulMbo=appBean.getMbo()
    appBean.targetStatusOption=maxvalue
    appBean.statusChangeButtonSigoption=maxvalue
    statefulMbo.setTargetStatusOption(maxvalue)
    statefulMbo.setStatusChangeButtonSigoption(maxvalue)
    appBean.STATUSSUB()
    session.loadDialog(dialogid)
    statusBean=session.getCurrentApp().getDataBean(dialogid)
    if statusBean:
        statusBean.setValue("STATUS",value)​


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



  • 5.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Mon March 21, 2022 04:28 PM
    Hi Steven,

    Thanks again for the push in the right direction! 

    Your script worked perfectly... the only thing I found was that from the list tab with no specific records selected, it wasn't raising the "ConfirmListAction" warning message. So I had to manually raise that in the script.

    Will poke around to try to figure out the "invalid binding" hiccup... but that only occurs if i cancel the dialog the launch it again immediately (which shouldn't happen often).

    maxvalue="COMP"
    value="WCLOSE"
    session=service.webclientsession()
    dialogid="status"
    if session.getCurrentApp().onListTab():
        dialogid="list_status"
    
    def yes():
        appBean=session.getCurrentApp().getAppBean()
        statefulMbo=appBean.getMbo()
        appBean.targetStatusOption=maxvalue
        appBean.statusChangeButtonSigoption=maxvalue
        statefulMbo.setTargetStatusOption(maxvalue)
        statefulMbo.setStatusChangeButtonSigoption(maxvalue)
        appBean.STATUSSUB()
        session.loadDialog(dialogid)
        statusBean=session.getCurrentApp().getDataBean(dialogid)
        if statusBean:
            statusBean.setValue("STATUS",value)
        
    def no():
        result = "no"
    
    def dflt():
        service.log("dflt")
        service.yncerror("jspmessages", "ConfirmListAction") 
    
    cases = {service.YNC_NULL:dflt, service.YNC_OK:yes, service.YNC_CANCEL:no}
    
    if dialogid=="list_status":
        x = service.yncuserinput()
        cases[x]()
    else:
        yes()​


    ------------------------------
    Ryan Coghlin
    ------------------------------



  • 6.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Mon March 21, 2022 04:45 PM
    This prompt typically comes from the signature option but that can't be utilized when you need to invoke an automation script action since it's a radio button (only 1 can be selected). If you look at the APPR sigoption for example and you expand it you'll see the warning option is selected under the Advanced Signature Options. Your use of the YNC is good to still implement that prompt though.

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



  • 7.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Tue March 15, 2022 09:49 AM

    Hi Ryan,

    A couple of things I noticed.  First, the names of things need to match in order for this to flow.  I see that the Action is "WO CLOSE", where as the sigoption is WCLOSE.  These all need to match in order for the framework to follow the path.  Also, when setting up the sigoption, under the advanced section, I believe you need to select the choice around user needing to action using the UI.  I set this up using that option and WCLOSE for everything and it worked like a charm.  :-)



    ------------------------------
    Steve Hauptman
    ------------------------------



  • 8.  RE: Synonym Status won't display Change Status dialogue from Common Actions

    Posted Mon March 21, 2022 09:31 AM
    Hi Steve H,
    You were right! When I created a new action called "WCLOSE" (same as sigoption name) and made sure the sigoption was "invoked by user in the UI", then the Common Action worked to set the WO to WCLOSE status.

    I will keep this approach in mind. But in this case, I was hoping to raise the Change Status dialog so the user could record record a memo and be able to cancel, if needed. I'm going to give Steven S' approach a try (using an "action launch point automation script that loads the dialog") -- hopefully that works out.

    Thanks,
    Ryan



    ------------------------------
    Ryan Coghlin
    ------------------------------