SHARK process startup process
1) Positioning a workflow server
Shark.configure ("Shark.conf");
Sharkinterface Si = Shark.getInstance ();
2) Connect the workflow server
Sharkconnection sc = si. Getsharkconnection ();
Sc. Connect (username, pwd, engineename, scope);
3) Generate the process
WfProcess WFP = sc.createProcess (PKGID, PDEFID);
When the process is generated, use SharkConnection objects, and the user information is saved, and user information is used as a Requester for generated processes;
Then use two parameters: package definition ID and process definition ID to get the ID of the process manager;
Finally, use the process manager to generate the process
4) Startup process
WFP.Start ();
After a few rounds of Shark, the last implementation is in org.enhydra.shark.wfProcessimpl, the code is implemented as follows:
// There is an abnormal judgment
// The startup time is later
StartedTime = system.currenttimemillis ();
// change the state
Change_State (T, SharkconStants.State_Open_Running);
// Activation timer
THIS.ActivateLimitAgent (T);
// Drive process
Run (T, NULL);
5) Disconnect
Disconnect (SC);
Return Wfp.Key ();