Hi Huda Al-Masoud,
Did you manage to get past this issue? Why not use the SourceCode.Workflow.Client Namespace, WorklistCriteria class?
Regards,
Frikkie!
Hi,
Thank you I already done from this issue, I found way to solve it using Criteria.ProcessInstanceCriteriaFilter.
regards,
Can you share this with us, i am going through this issue too.
i want the tasks with the highest priority come first regardless of their date
Hi,
I wrote the below code, for sure you need to change it according to your need:
Dim arrPriority As String() ...... ' use this to store the priority/ priorities you select
Dim regularFilter As New SourceCode.Workflow.Management.Criteria.RegularFilter()
Dim workflowPriorityValue As WorkflowPriority ' I put the priorities as enum in this class
regularFilter.ColumnName = "aPI].Priority" ' 0tableName].ColumnName ... note that PI is the name of the table that the k2 create when it used its generated sp to handle this type of filtration you should not care about the SP it will be generated by itself
regularFilter.DbType = DbType.String
regularFilter.Comparison = Criteria.Comparison.Like
' handle selection for one priority
If (arrPriority.Length = 1) Then
regularFilter.ParameterName =
"@WORKFLOW_PRIORITY" ' you can use any parameter name this will be used in genrated SP.
workflowPriorityValue = wEnum].Parse(GetType(WorkflowPriority), arrPriority(0), True)
Else
' Handel the selection for two priorities
regularFilter.ParameterName =
"@WORKFLOW_PRIORITY"
workflowPriorityValue = lEnum].Parse(
GetType(WorkflowPriority), arrPriority(0), True)
Dim regularFilter2 As New
SourceCode.Workflow.Management.Criteria.RegularFilter()
regularFilter2.ColumnName =
"ePI].Priority"
regularFilter2.ParameterName =
"@WORKFLOW_PRIORITY2"
workflowPriorityValue = kEnum].Parse(
GetType(WorkflowPriority), arrPriority(1), True)
End If
Note:
This code is used to handle selection for one ot two different priorities from "High, Medium, low". becuase in my case if I select none or all priorities type I must return all tasks like I did not do any filtration. So I handle the selection of only one or two priorities.
Regards,
Huda Al Masoud