SHARK process hang process
1) Get the execution manager interface
ExecutionAdministration EA = Shark.GetInstance (). GetAdmininterface () .. getExecutionAdministration ();
2) Connect the workflow server
Ea.Connect (username, password, engineenename, scope);
3) Get the process with the process instance number
WfProcess WFP = EA.GETPROCESS (ProcessinsKey);
4) Suspending process
Wfp.suspend ();
Here are the specific analysis of hang operations
// The state cannot be hanging
IF (STATE (T) .Equals (SharkConstants.State_Open_not_running_suspend) {
Throw New Alreadysuspended ("The Process IS Already Suspend");
}
/ / Running the process to hang
IF (State (T) .StartSwith (SharkConstants.StatePrefix_Open_not_running) {
Throw new Notrunning ("The Process Is Not In The Running State);
}
Try {
// change the state
Change_State (t, sharkconstants.state_open_not_running_suspend);
Iterator it = getActiveActivities (T) .Itemrator ();
While (it.hasnext ()) {
WFActivityInternal Act = (wfActivityInternal) it.next ();
/ / Do the same operation for each activity
IF (act.state (t) .startswith (SharkConstants.StatePrefix_open) {
Act.suspend (t);
}
}
}
5) Disconnect
Ea.disconnect ();