thanks
Simon
Hi Si_b,
Can you explain bit more, what do you want to do with process instance, Are you talking about
WorklistItem.ProcessInstance.Id ?
This would be useful functionality to add to our applications. Our users like to know exactly what version of the workflow they are running. It would also help our helpdesk out.
Martin
Is there any solution for this? I also would like to know this :)
Best regards,
Chris
You can get the version number from the Management API. Sample code:
SourceCode.Workflow.Management.WorkflowManagementServer oS = new SourceCode.Workflow.Management.WorkflowManagementServer();
oS.CreateConnection();
oS.Connection.Open(ConStr);
SourceCode.Workflow.Management.Criteria.ProcessInstanceCriteriaFilter f2 = new SourceCode.Workflow.Management.Criteria.ProcessInstanceCriteriaFilter();
f2.AddRegularFilter(SourceCode.Workflow.Management.ProcessInstanceFields.ProcInstID, SourceCode.Workflow.Management.Criteria.Comparison.Equals, "164"); // Use the ProcInstID
SourceCode.Workflow.Management.ProcessInstances ps = oS.GetProcessInstancesAll(f2);
if (ps.Count == 1)
{
int iVer = oS.GetProcess(pss0].ProcID).VersionNumber;
}
else
{
// Handle not found
}
Just note that the account executing this code need to be an Administrator on the K2 Server.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.