Maximo Open Forum

 View Only
  • 1.  Triggering Status Change Logic Without Changing Status

    Posted 02-15-2022 15:31
    Wondering if anyone has ever tried firing status change logic against a record with an automation script without actually changing the status. With an automation script I would like to fire the logic to see if a record can be approved without actually changing the status to approved. I envision this being a push button that saves and validates the record to see if it can be approved. This would be similar to the validate option in escalations where it checks to see if the escalation could be activated without actually activating it.
    #Administration
    #Integrations

    ------------------------------
    Phil Runion
    Projetech
    ------------------------------


  • 2.  RE: Triggering Status Change Logic Without Changing Status

    Posted 02-15-2022 15:53
    Most objects with a status extend StatefulMbo. Provided that is the case, you can use something like mbo.canChangeStatus("APPR") for example to test whether or not it could be approved. When not allowed it will throw an error though so you'll need to wrap it in a try catch. That's assuming all the logic you need is handled at that level and not during the execution of the status change.

    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: Triggering Status Change Logic Without Changing Status

    Posted 02-16-2022 15:25
    Thank you for the recommendation. I ran with it and found the function just as you described. It ends up calling validateForApproval() so I called this in my code on the mbo, mbo.validateForApproval(), and it worked great. Appreciate the help.

    ------------------------------
    Phil Runion
    Projetech
    ------------------------------



  • 4.  RE: Triggering Status Change Logic Without Changing Status

    Posted 02-17-2022 17:08
    Phil - not sure which object you're working on, but be aware that not all of the logic for approval is contained in the validateForApproval() method across most purchasing records. There are still some checks in the approve() method that aren't found elsewhere.

    I created an RFE a little while back for implementing a canApprove() method in the StatusHandler class across common purchasing objects:
    https://ibm-ai-apps.ideas.ibm.com/ideas/MASM-I-329

    Hope this helps.

    ------------------------------
    Alex Walter
    A3J Group, LLC
    ------------------------------