Skip to main content
Nintex Community Menu Bar
Solved

SourceCode.Workflow.Managagement with filter produces an error

  • April 16, 2018
  • 4 replies
  • 27 views

Forum|alt.badge.img+2

Hi,

 

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

 

Thanks

Steve

Best answer by khanh1

Hi,

Perhaps you can check out the ServerLog.Status table

4 replies

Forum|alt.badge.img+18
  • April 16, 2018

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/


Forum|alt.badge.img+2
  • Author
  • April 17, 2018

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;
}


Forum|alt.badge.img+2
  • Author
  • April 17, 2018

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..


Forum|alt.badge.img+16
  • Answer
  • April 17, 2018
Hi,

Perhaps you can check out the ServerLog.Status table