Maximo workflows are really easy to use, but in the process of custom development, especially tianchao, there are too many leaders and too many requirements, and the requirements for workflows are increasingly complicated and cumbersome. This forced us to use code to control the workflow during secondary development. Recently, some simple functions have been processed and listed for sharing.
Bytes ---------------------------------------------------------------------------------------------------
1. initialize the workflow, that is, start the workflow, which is equivalent to clicking the send button of the workflow icon for the first time.
((WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW"))
.initiateWorkflow("CUMRFAC", mrfactory_srm.getMbo(0));
Initiateworkflow ("cumrfac", mrfactory_srm.getmbo (0) parameters are: (workflow name, MBO)
2. Stop the workflow, that is, terminate the workflow.
// Stop the workflow wfinstancesetremote mset = (wfinstancesetremote) getmbo (). getmboset ("wfinstance"); wfinstanceremote instance = (wfinstanceremote) mset. getmbo (0); instance. stopworkflow ("stop ");
First, obtain the mboset of the workflow, then obtain the current MBO, and finally stop it.
3. Send the workflow, which ends when the workflow is sent
((WorkFlowServiceRemote)MXServer.getMXServer().lookup("WORKFLOW"))
.completeAssignment((WFAssignmentRemote)orderMbos.getMbo(0)
. Getmboset ("wfassignment"). getmbo (0), "agree", true );
Bytes ---------------------------------------------------------------------------------------------------
Write this article first. Welcome to the discussion. (keep updating ····)