Solved

SourceCode.Workflow.Managagement with filter produces an error

  • 16 April 2018
  • 4 replies
  • 9 views

Badge +2

Hi,

 

Trying to use the K2 SourceCode.Workflow.Managagement with filter produces an error "error converting nvarchar to int" - any suggestions?

 

Thanks

Steve

icon

Best answer by khanh1 17 April 2018, 15:08

View original

4 replies

Userlevel 5
Badge +18

Please attach some detail/line of codes where this is thrown.


From the error so far, perhaps a different method/overload/parameter type was used than what was intended?


https://vijaydk2guy.wordpress.com/2017/09/16/exploring-sourcecode-workflow-management-getworklistitems-method/

Badge +2

here's the piece of code I use to GetWorkListItems - filters are commented out since they cause the above mentioned problem.

p.s - I use only 1 filter at a time just for clarification due to the FilterCondition.AND statements at the end.

 

public static WorklistItems GetWorkflowList()
{
SourceCode.Workflow.Management.Criteria.WorklistCriteriaFilter filter = new SourceCode.Workflow.Management.Criteria.WorklistCriteriaFilter();
WorkflowManagementServer wms = GetWFManagementServer();
if (wms.Connection.IsConnected)
{
filter.AddRegularFilter(SourceCode.Workflow.Management.WorklistFields.ProcessFullName,
SourceCode.Workflow.Management.Criteria.Comparison.Equals, "LPE.BrokerUnderwriterLPEBrokerUnderwriter");
//filter.AddRegularFilter(SourceCode.Workflow.Management.WorklistFields.Status,
// SourceCode.Workflow.Management.Criteria.Comparison.Equals, "Available", RegularFilter.FilterCondition.AND);
//filter.AddRegularFilter(SourceCode.Workflow.Management.WorklistFields.Status,
// SourceCode.Workflow.Management.Criteria.Comparison.Equals, "Open", RegularFilter.FilterCondition.AND);
}
WorklistItems wi = wms.GetWorklistItems(filter);
return wi;
}

Badge +2

found the problem ... in the filter the Status is an Integer value rather than a string - what table do I look in to find the Status numbers? all I see in the worklist is the string representation of the status such as "Available", "Open" etc..

Userlevel 6
Badge +16
Hi,

Perhaps you can check out the ServerLog.Status table

Reply