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 ();