November 12, 2013

Automatically stop workflow on closed work orders

When using a workflow to drive the status changes of an object in Maximo you shouldn't allow the users to change the status directly through the 'Change Status' action. This could be easily done removing the 'Change Status' sigoption from relevant users groups.
When users have both options enabled, it may happen that a closed work order has an active workflow on it.

In such cases you can create an escalation to automatically stop workflow on closed work orders.

First of all you have to create an action like this.
  • Action: STOPWF
  • Object: (leave blank)
  • Type: Custom
  • Value: psdi.workflow.StopWorkflowAction
Unfortunately the StopWorkflowAction class is included in Maximo 7.5.

Then you can create the escalation.
  • Escalation: STOPWF
  • Applies to: WFINSTANCE
  • Condition:active=1 and OWNERTABLE='WORKORDER' and exists (select 1 from workorder where status in ('CAN', 'CLOSE') and workorderid=ownerid)
  • Schedule: as you like
  • Action: STOPWF

Refer to this IBM TechNote for more details.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. You can also use a condition node at the beginning of the workflow: where status in ('CAN','CLOSE','COMP') and then route the positive line to the stop node and route the negative line to the next node in the workflow.

    I sometimes prefer this, as it keeps the development consolidated to the workflow, and prevents potential mishaps by not having the escalation running, or stuck on a donotrun list.

    ReplyDelete
  3. kindly tell how to cancel MR when MR status is Draft .. i want to cancel MR through Escalation

    ReplyDelete