Maximo

 View Only
Expand all | Collapse all

Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

  • 1.  Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Fri April 07, 2023 02:20 PM

    Requirement:
    User A is completed the workorder and again, same user A  is going to change the work order status to 'CLOSE'. At that moment, have to pop up warning message as "You have completed this WO. Do you want to proceed?". This warning message is need to work for the below scenario

    1. "Change Status" option for single WO
    2.  "Close Workorder" option for single WO
    3. "Change Status" option for multiple WO from List Tab
    4. "Close Workorder" option for multiple WO from list tab

    We tried, created  Attribute Launch Point for WOCHANGESTATUS Object (Run action event). Script is working for 1, 2, 3 scenario but not working for last scenario. 
    "Close Workorder" option for multiple WO from list tab, Automation script is not calling and not working.

    Does anyone suggest how to handle the "Close Workorder" option for multiple WO from list tab to show warning message.

    Thanks in Advance! :-)







    ------------------------------
    Nivethitha S
    ------------------------------


  • 2.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Tue April 11, 2023 12:04 AM

    Which data set are You using in script?
    By default WO application is working with clause historyfalg=0 . If You are using application default mboset, then after closing those WOs, they are not in that mboset anymore. I guess, this could be the issue for 4th scenario.



    ------------------------------
    Juris Flugins
    ------------------------------



  • 3.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Thu April 13, 2023 08:34 AM

    Hi Juris Flugins, 

    Thank you for your reply!.

    We have selected around 20 open workorder in the List tab and trying to close using 'Close Workorder' option from list tab. In this Case, Automation script is not triggers for this 'Close Workorder' option.



    ------------------------------
    Nivethitha S
    ------------------------------



  • 4.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Wed April 12, 2023 10:17 AM

    Hi Nivethitha,

    Below technote asserts that automation script does not fire on list tab when no records are selected. That might be the cause or the CLOSE button might be calling changeStatus method directly w/o the non-persistent object. Yet, if that message is important, I can recommend some workarounds.

    Tech Note:
    https://www.ibm.com/support/pages/automation-scripts-fire-list-tab

    Option 1: Since item 3 works, you can replace CLOSE button with a copy of STATUS dialog having readonly status (no dropdown / lookup) defaulted to CLOSE.

    Option 2: Replace CLOSE button with a new sigoption & automation script which handles the message and single / list of WO status change to CLOSE. 




    ------------------------------
    YALCIN KUMBASAR
    ------------------------------



  • 5.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Thu April 13, 2023 08:39 AM

    Hi Yalcin Kumbasar,

    Thank you for your reply!

    We were selected around 10 open records in the list tab of workorder tracking application, then selecting the 'Close Work order' option from select action.
    At that point, Automation script is not triggers to show warning message dialog box. Could you please suggest.

    Thanks in Advance!




    ------------------------------
    Nivethitha S
    ------------------------------



  • 6.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Fri April 14, 2023 03:32 PM
    Edited by Subhransu Sekhar Sahoo Fri April 14, 2023 03:42 PM

    Hi Nivethitha,

    To call the script for the last option (Close Workorder" option for multiple WO from list tab), you need to change your launch point event to "Initialize value" instead of "Run Action" as Close status value has been already defaulted/initialized when you opened the "Close Workorder" dialog box, so there is no event changes in the WOCHANGESTATUS.STATUS field and as a result the script didn't fire. 
    In other cases, you are setting the the status value manually un the dialog box and causing an event to call the script.

    Now the catch is how did it work for the second option ("Close Workorder" option for single WO)?

    It did worked for the second option as the MBO(i.e WO here) inherits the StatefulMbo class which has the ChangeStatus method. But once you select multiple WO records in list tab, it becomes an MboSet(i.e WOSet) and unfortunately the MboSet neither inherit the StatefulMbo Class nor it overrides the ChangesStatus method, so the same code didn't work when you select the record from list tab and tried to close them through the Close Workorder More action menu. Hope this clears everything now.

    Please test that with initialize value attribute launch point and let me know how it goes.

    -----------------------------
    Subhransu Sekhar Sahoo
    ------------------------------



  • 7.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Sun April 16, 2023 02:52 PM
    Hi All,

    I want to evaluate the work order total cost (here total means for all child WOs).
    I can see this information in Main WO->More Actions->View ->Cost.

    This comes from WOGRANDTOTAL which is non persistent object.
    So, the attribute Total is ALN value and not AMOUNT/INTEGER.

    I want to evaluate this total cost (planned - labor,material,services,tool) for the whole WO hierarchy, and based on some conditions, I must send the Main WO to different people/roles for approval, hence I am trying to use workflow here.

    I am not sure whether we can use non persistent objects in Workflow. I tried in condition node, but it always evaluates to false irrespective of total cost.
    Also INTEGER(:WOGRANDTOTAL.TOTAL) is not working.

    Please let me know how to achieve this.

    Regards,
    SV Aparna
    IBM | Maximo Consultant |
    Bangalore
    +91 - 9972016373

    IBM Holiday:
    01 May 2023
    Upcoming OOO :
    02 May 2023 - 5 May 2023




  • 8.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Wed April 19, 2023 02:04 AM

    Hi Subaransu,

    Thank you for your response with explanation! It's really helpful to understand the logic.

    I have tried by changing the "Initialize value" instead of "Run Action."  The automation script is not triggers for all the four scenarios. Automation scripts fails for all the four cases. 





    ------------------------------
    Nivethitha S
    ------------------------------



  • 9.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Wed April 19, 2023 03:43 AM

    Hi Nivethita,

    As per my previous explanation, You should only use the "Initialize value" launch point for the "Close Workorder" option for multiple WO from list tab" option, not for all. For the first three option, "Run Action" launch point should work for other three. 

    Keep "Run Action" for the First three option and use "Initialize Value" only for the last option.

    Let me know how it goes.



    ------------------------------
    Subhransu Sekhar Sahoo
    ------------------------------



  • 10.  RE: Attribute Launch Point for WOCHANGESTATUS Object (Run action event)

    Posted Thu April 20, 2023 11:58 AM

    Hi! Just a note about launch points. All the launch point are mbo events (somewhere), and an mbo can hide it's events, so sometimes an event that is obviously occurring does not propagate to the script context. I have snippets that will immediate log various state info from mbo's (there's likely a better way now though)...

    In the case of init events, there is no guarantee that any related mbo's exist at 'this' mbo's init event (think relationships). Most more disturbing :-) is I have seen init scripts fail silently, never exposing any error (hint, surround suspect statements with immediate logging). 

    Anyway, have fun and discover!



    ------------------------------
    keith simmons
    ------------------------------