Skip to main content

Hi


i used this code to retrieve all the process instances that are in error state..but it seems that it doesnt work.


i tried to search the k2 site but search was off on this day


-------------------------------------------------------------------------------------------------------------


WorkflowManagementServer wms = new WorkflowManagementServer("Server", 5555);


wms.Open();


WorklistCriteria cri = new WorklistCriteria();


cri.AddFilterField(WCField.WorklistItemStatus, WCCompare.Equal, "0");


//WCField.WorklistItemStatus


//WorklistItems wi = wms.GetWorklistItems(DateTime.MinValue,DateTime.MaxValue, "%", "%", "%", "%", "%");


WorklistItems wi = wms.GetWorklistItems(cri);


-----------------------------------------------------------------------


how to do it in code?

can anybody answer it?



You can use the SourceCode.Workflow.Management API:

SourceCode.Workflow.Management.WorkflowManagementServer wfServer = new SourceCode.Workflow.Management.WorkflowManagementServer();


wfServer.CreateConnection();


wfServer.Connection.Open(connectionString.ToString());


ErrorLogs
els
=
wfServer.GetErrorLogs(wfServer.GetErrorProfile("All").ID);


foreach
(
ErrorLog
el
in
els)


{ 


// list errors


}



Some days back I read a topic K2 Process Error Notification (PEN) service posted by a gentleman. You can use K2 PEN to get details of all processes those are in error stage. To get details about K2 PEN, just search in K2 Underground.


 


Hope this helps you.


Do you need to do it using the K2 API?  You could maybe run a SQL query against the K2Server database, _ProcInst table and get all procinstid's where the status of the process equals '0'.


Regards,
Frikkie!


Reply