Skip to main content
Nintex Community Menu Bar

Get ProcessInstances

  • October 31, 2006
  • 5 replies
  • 10 views

Forum|alt.badge.img+2
I am coding a application to get All ProcessInstances in K2Server which originator by a specific person.

I used K2Manager to get All process , but the class K2Manager.ProcessInstance don't have any method to access the Destination Activity object.

Show me the solution ,pls!

Thanks a alot !

5 replies

Forum|alt.badge.img+11
  • Nintex Employee
  • October 31, 2006
Have a look at the sample posted here:
http://forum.k2workflow.com/viewtopic.php?p=5862#5862

I have not tested it myself but hopefully it can help you.

Regards,
Ockert

Forum|alt.badge.img+13
  • Rookie
  • October 31, 2006
Open K2MNG Help file search for GetProcessInstancesAll. It has sample code.

Originator
Filter the result based on the Originator of the ProcessInstance.

Public Function GetProcessInstancesAll( _
Optional ByVal FullName As String, _
Optional ByVal Folio As String, _
Optional ByVal Originator As String, _
Optional ByVal FromDate As String, _
Optional ByVal ToDate As String _
) As ProcessInstances

Forum|alt.badge.img+2
  • Author
  • October 31, 2006
But use ProcessInstance class in K2Manager namespace, we can't get the Destination Activity name and the Destination User of the current processInstance.

We can do it with WebServices support by K2 (FilterService).??????

Help me!!

Forum|alt.badge.img+13
  • Rookie
  • November 10, 2006
Dim oWorklistItems As K2Mng.WorkListItems

oWorklistItems = oK2Manager.GetWorkListItems(strDestination, strProcess, strActivity, strEvent, strFolio, strStartDate, strEndDate)

Use that and you can get the ActivityName, there is a oWorklistItems.Destination object but I have not figured out how to use that Destination object... someone from K2 can assist?

Forum|alt.badge.img+9
  • Nintex Partner
  • November 11, 2006
The K2Mng.WorklistItem.Destination object is a string, so just doing a ToString() on it should return the destination user for that specific worklist item.



WorkListItems oWorklistItems = oK2Manager.GetWorkListItems(strDestination, strProcess, strActivity, strEvent, strFolio, strStartDate, strEndDate);

if (oWorklistItems.Count > 0)
{
foreach (WorkListItem oWorklistItem in oWorklistItems)
{
string strActivityName = oWorklistItem.ActivityName;
string strDestinationUser = oWorklistItem.Destination.ToString();
string strEventName = oWorklistItem.EventName;

// do something with the values here
}
}