Question & Answer
Is it possible to stop multiple records that are in Workflow at once?
Maximo allows you to stop 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
Maximo 7.5 (for Maximo 6 or 7.1.x contact Support to get the class file) has a class file you can use that will help you stop Workflow on many records at one time. This classfile:
is in this folder:
NOTE: For Maximo 6 and Maximo 7.1 you will need to rebuild and redeploy the EAR files and restart the Maximo Application Server after inserting the StopWorkflowAction.class file into this folder:
To use it you first create an Action and then run it with an Escalation as described below. The Class file will change the Active Inbox Assignments to Assignstatus “Inactive” which will remove them from the Workflow Inbox and will add a transaction to WFTransaction table saying that the Workflow process was stopped.
Create an Action:
Object: (leave blank)
(you may cut and paste the value above into the Value field)
Create an Escalation:
Applies To: WFINSTANCE
Condition: (see below)
Escalation point: Only needs to exist, all fields can be left blank with the exception that the Escalation Point will be ‘1’
Action: Pick the Action made above
Set a schedule and Activate the Escalation.
The condition will need to query the WFInstance table. When a record is started in Workflow it gets 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 above is based on the Workorder table. Here we want to stop all workorders 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 will select and then you will deactivate the Escalation.
17 June 2018