Getting all process instances for a specific user

  • 12 April 2012
  • 3 replies
  • 2 views

Badge +6

Does the Folio have to be unique?


I’m looking at getting all instances of a process for a specific user:


 


SourceCode.Workflow.Management.WorkflowManagementServer svr = new WorkflowManagementServer(servername, serverport);


svr.Open();


ProcessInstances procinsts = svr.GetProcessInstancesAll("testLeaveRequestLeaveRequest", "TestUser LeaveRequest", "K2:VSSPusername");


 


This procinsts doesn’t return anything yet I see the process instance in the workspace. Am I looking in the wrong place?:



3 replies

Badge +6

After looking at this further i noticed that all instances that are complete are not showing up. Is that the way it should work? If so, is there a way to make even the completed instances appear?


thanks again.

Badge +10

Hi,


To answer your first question, no. The folio is an identifier which can be set to anything and there are no checks being done to check whether it is unique.


Your code above will only fetch active process instances, if you need active and completed instances I would suggest that you use the Reporting SmartObjects to obtain a list of process instances for a user. Look specifically at the Process_Instance SmartObject. You can find code on how to execute this SmartObject from the Developer Reference under SmartObjects > Accessing > How to filter data returned from a SmartObject. Use the SmartObjects - Services Tester to test this out.


Hope this helps!

Badge +6

You rock! That got what i was looking for. Thanks again

Reply