Shark interface 1 Analysis (2)-suspend Process

Source: Internet
Author: User

 

SharkProcess suspension process

1) Get the execution Manager interface

Executionadministration Ea = shark. getinstance (). getadmininterface () .. getexecutionadministration ();

2) connect to the Workflow Server

EA. Connect (username, password, enginename, scope );

3) use the process instance number to obtain the process

Wfprocess WFP = EA. getprocess (processinskey );

4) pending process

WFP. Suspend ();

The following is a detailed analysis of pending operations.

// The status cannot be suspended

If(State (T). Equals (sharkconstants. state_open_not_running_suspended )){

Throw NewAlreadysuincluded ("the process is already susponded ");

}

// The running process can be suspended.

If(State (T). startswith (sharkconstants. stateprefix_open_not_running )){

Throw NewNotrunning ("the process is not in the running state ");

}

Try{

// Change the status

Change_state (T, sharkconstants. state_open_not_running_suspended );

 

Iterator it = getactiveactivities (T). iterator ();

While(It. hasnext ()){

Wfactivityinternal act = (wfactivityinternal) it. Next ();

// Perform the same operation on each activity

If(Act. State (T). startswith (sharkconstants. stateprefix_open )){

Act. Suspend (t );

}

}

}

5) disconnect

EA. Disconnect ();

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.