how to get all the Worlist instances that are in error state in k2


Badge +1

Hi,

 

I am tyring to get the list of process instances which are in error state and restart those instances throught code. Is there any API for this.

Cuarrently I am using GetWorklistItems method of K2 to get all the process instances, but this doenst give instances in error state.

 

 

 

Please let me if there is any API for this.

 

Thank you,

Dinesh


2 replies

Badge +8

It's not well documented, but you need to use the SourceCode.Workflow.Management namespace.  Connect to the sever with the WorkflowManagementServer class, then use the GetErrorProfile() and GetErrorLogs() methods in that object to get the collection of processes currently in error state.  You can then use the RetryError() method to try and restart the process.

 

There is also a K2 Error Notification Service that might interest you.  While the service is intended to send notifications when it finds a process in the error state, the code is a good point of reference to get you started.  We consulted this when writing our own error monitoring service for K2 that integrates into our pre-existing logging environment.

Badge +1

Hi, Thanks for the info.. that's all I was looking for.

 

 

Reply