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 !
Page 1 / 1
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
http://forum.k2workflow.com/viewtopic.php?p=5862#5862
I have not tested it myself but hopefully it can help you.
Regards,
Ockert
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
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
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!!
We can do it with WebServices support by K2 (FilterService).??????
Help me!!
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?
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?
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
}
}
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.