Workflows can be programmatically initiated in Maximo using WorkFlowService
class. Here is a sample Automation Script for a new record:
1 2 3 4 5 6 7 8 9 10 11 12 13 | from psdi.util import MXException from psdi.server import MXServer try : # only initiate workflow for new records if (mbo.isNew()): mxs = MXServer.getMXServer() wfstart = mxs.lookup( 'WORKFLOW' ) # replace the 'processName' with the workflow process you want to initiate wfstart.initiateWorkflow( "processName" ,mbo) except Exception, e: print (e) |
In the above script, we need to replace the processName
with the workflow process we want to initiate.
The launch point for the Automation Script should be ‘
After Save'
. Please note that ‘Before Save'
may not work in certain situations for initiating the workflow.