Shark interface 1 analysis (1)-Startup Process

Source: Internet
Author: User

 

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.