MAXIMO 7: Use code to control workflows

Source: Internet
Author: User

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 ····)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.