Shark process resume 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) Resume process
WFP.Resume ();
Below is the specific analysis of the resume operation
// There is no pending process can't be resme
IF (! STATE (T) .Equals (SharkConstants.State_Open_not_running_suspend) {
Throw New NotSuspended ("The Process IS Not Suspend");
}
// Source code Description: if this is a subsflow process of suspended activity, and it is executed as synchronous, do not allow process to resume
WFrequesterinternal Requester = GetRequester (t);
IF (Requester! = Null && (Requester InstanceOf WFActivityInternal) {
WFActivityInternal Waimpl = (wfActivityInternal) Requester;
IF (WAIMPL.STATE (T) .Equals (SharkConstants.State_Open_not_running_suspend) {
// determine subsflow type
IF (XPDLUTILITIES.issubflowsynchronous (Sharkutilities.GetActivityDefinition (t, waimpl, getProcessDefinition (t)))) {
SharkengineManager.getInstance (). GetCallbackutilities (). Error ("Process" TSTRING () "- Cannot Resume Because The Requester Activity Is Suspend");
Throw New CannotResume ("Cannot Resume - The Requester Activity is Suspend");
}
}
}
// change the state
Change_State (T, SharkconStants.State_Open_Running);
// put all the events, RESUME
Iterator it = getActiveActivities (T) .Itemrator ();
While (it.hasnext ()) {
WFActivityInternal Act = (wfActivityInternal) it.next ();
IF (act.state (t) .Equals (SharkConstants.State_Open_not_running_suspend) {
Act.Resume (t);
}
}
5) Disconnect
Ea.disconnect ();