SharkProcess initiation process
1) locate the Workflow Server
Shark. Configure ("Shark. conf ");
Sharkinterface Si = shark. getinstance ();
2) connect to the Workflow Server
Sharkconnection SC = Si. getsharkconnection ();
SC. Connect (username, PWD, enginename, scope );
3) Production Process
Wfprocess WFP = SC. CreateProcess (pkgid, pdefid );
The sharkconnection object is used to generate a process. The object stores user information and uses user information as the requester of the generated process;
Then, two parameters are used: the package definition ID and the process definition ID to obtain the ID of the Process Manager;
Finally, use the Process Manager to generate a process.
4) start the process
WFP. Start ();
After several rounds of shark jump, the final implementation is in org. enhydra. Shark. wfprocessimpl. The implementation code is as follows:
// Previous exception judgment
// Start time must be later
Startedtime = system. currenttimemillis ();
// Change the status
Change_state (T, sharkconstants. state_open_running );
// Activate the timer
This. Activatelimitagent (t );
// Drive the process
Run (t,Null);
5) disconnect
Disconnect (SC );
ReturnWFP. Key ();