IWFWorkflowService svc = GetWorkflowService();
try
{
//WebMethod with sql query expression as argument.
WFAny any = WFAny.Create(WFAutomaticWorkItem.WAITING);
WFQueryExpr expr = new WFQueryExpr("STATUS", SQLExpr.EQ, any, true);
WFAutomaticWorkItem[] result = svc.QueryProcedureList(expr);
if (result != null)
{
// Iterating through the list of the automatic work item
foreach (WFAutomaticWorkItem re in result)
{
Console.WriteLine("ActivityInstID-->" +
re.ActivityInstID);
Console.WriteLine("ApplName-->" + re.ApplName);
Console.WriteLine("ProcInstID-->" + re.ProcInstID);
Console.WriteLine("CreatedDate-->" + re.CreatedDate);
}
}
}
catch (Exception ex)
{
Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
}