IBM Support

Using StopWorkflowAction.Class to Stop Multiple Records in Workflow at Once

Question & Answer


Question

Is it possible to stop multiple records that are in Workflow at once?

Answer

Maximo stops records one at a time that are in Workflow by either:
  • using the Workflow Administration application
  • using the Select Action - Workflow - Stop Workflow menu item in the application
Use this class file to stop Workflow on many records at one time:
      StopWorkflowAction.class
It is located in this folder:
...\maximo\applications\maximo\businessobjects\classes\psdi\workflow
To use it, you first create an action and then run it with an escalation.  The Class file changes the Active Inbox Assignments to Assignstatus “Inactive” which removes them from the Workflow Inbox and adds a transaction to WFTransaction table indicating that the Workflow process was stopped.
Create an Action:
  • Object:  Leave this blank.
  • Type:  Custom
  • Value:  psdi.workflow.StopWorkflowAction (cut and paste the value here into the Value field)



Create an Escalation:
  • Applies To:  WFINSTANCE
  • Condition:  See screenshot.
  • Escalation Point:  An escalation point needs to exist, all fields can be left blank with the exception that the Escalation Point is ‘1’.
  • Action:  Pick the Action.
  • Set a schedule and activate the escalation.




The condition needs to query the WFInstance table.  When a record is started in Workflow, it is entered into the WFInstance table. WFInstance.ownertable is set to the table of the record's object, for example: ‘WORKORDER’, 'PO', or 'SR'
WFInstance.ownerid is set equal to the ID field of that Object, for example: Workorder.workorderid, PO.poid, or SR.ticketuid.
You can use Ownertable and Ownerid to relate the records from WFInstance back to the object whose records you want to stop in Workflow.

The sample is based on the WORKORDER table.  Here you want to stop all work orders that are Active in Workflow (Active = 1) that are Approved and at Location BR300. The Condition would be:

Active = 1 and ownertable = 'WORKORDER' and ownerid in (select workorderid from workorder
Where status = 'APPR' and location = 'BR300')
Typically you would let this escalation run just one time to stop the records your condition selects and then you deactivate the escalation.

[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU055","label":"Cognitive Applications"},"Component":"Workflow Actions","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB02","label":"AI Applications"}}]

Document Information

Modified date:
14 April 2021

UID

swg21593035