1) Connect using the currently logged in user
SourceCode.Workflow.Management.WorkflowManagementServer BPM = new SourceCode.Workflow.Management.WorkflowManagementServer("blackpearl",5555);
BPM.Open();
2) Connect using supplied credentials
SourceCode.Workflow.Management.WorkflowManagementServer BPM = new SourceCode.Workflow.Management.WorkflowManagementServer("blackpearl",5555);
BPM.Connection.Open("Host=BLACKPEARL;Port=5555;Integrated=True;IsPrimaryLogin=True;WindowsDomain=K2DEMO;UserID=Administrator;Password=k2pass;SecurityLabelName=K2;Authenticate=True");
Then you can do things like:
BPM.DeleteProcessInstances(intProcInstID, boolDeleteLogs)
or:
BPM.GetWorklistItems(lots of arguments, but not ProcessInstanceID);
or: .release .redirect .gotoActivity etc etc.