// Suppose we have defined the process proc1, which defines three activities, act1, Act2, and act3.
Executionadministration Ea = shark. getinstance (). getadmininterface (). getexecutionadministration ();
EA. Connect (username, password, enginename, null );
Adminmisc AM = shark. getinstance (). getadmininterface (). getadminmisc ();
// Process instance serial number, known
String procid = "1_1_proc1 ";
// Serial number of the active instance
String actid = "";
// Obtain the activity instance created so far by the process instance
Wfactivity [] wfas = EA. getprocess (procid). get_sequence_step (0 );
If (wfas! = NULL & wfas. length> 0)
{
// Obtain the serial number of the last active instance
Actid = wfas [WFA. Length-1]. Key ();
}
// Obtain the process definition number. Obtain proc1 here.
String procdefid = aM. getprocessdefinitionid (procid );
// Obtain the sequence number of the activity definition. Obtain one of act1, Act2, and act3 here.
String actdefid = aM. getactivitydefinitionid (procid, actid );
// P.s. You can see that using the shark. getinstance (). getadmininterface () method, you can obtain the shark management tool class. The API can obtain a lot of required information.