Skip to main content
Nintex Community Menu Bar

Getting process version in asp.net form

  • March 25, 2008
  • 5 replies
  • 23 views

Forum|alt.badge.img+2
How can I get the process version number for a particular process instance in my aspx form? I have found SourceCode.Workflow.Management.ProcessVersions (etc) but have no idea if that is what I need!

thanks

Simon

5 replies

Forum|alt.badge.img+8

Hi Si_b,

           Can you explain bit more, what do you want to do with process instance, Are you talking about

WorklistItem.ProcessInstance.Id ?
 


Forum|alt.badge.img+2
  • Author
  • March 26, 2008
As you know, every time you deploy a workflow K2 deploys it with a new version number. What I want to get at is that actual version number. Say I start a new instance ("instance A") at version 1, then deploy a new version, then start another instance ("instance B"), I want to be able to show on the aspx form "instance A - process version 1" or "instance B - process version 2" as appropriate.

Forum|alt.badge.img+7
  • March 28, 2008

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


Forum|alt.badge.img+2
  • October 27, 2010

Is there any solution for this? I also would like to know this :)


 


Best regards,


Chris


Forum|alt.badge.img+8
  • November 4, 2010

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(ps[0].ProcID).VersionNumber;


}


else


{


    // Handle not found


}



 


Just note that the account executing this code need to be an Administrator on the K2 Server.