Skip to main content
Nintex Community Menu Bar

Is K2 Bug? The ProcessData filter of WorklistCriteria not work

  • April 15, 2008
  • 6 replies
  • 29 views

Forum|alt.badge.img+1

I make use of SourceCode.Workflow.Client.dll to get K2 Process Worklist. In K2 Process, I add a Process Datafield "DealerCode", and when start process, I set value for this field, then in the Worklist query function,  I want to Implement the function which filtered by ProcessData "DealerCode" to get the disired WorklistItem. But even the matching WorklistItem is exist, the returned Worklist is alway null.  So I worry about if it's a K2 bug.


 The sample code show in below:


WorklistCriteria crit = new WorklistCriteria();


//dealerCode is the function parameter
crit.AddFilterField(WCLogical.And,WCField.ProcessData,"DealerCode",WCCompare.Equal,dealerCode);


//OpenConnection method is a wrapped method 


this.OpenConnection();
Worklist oWorkList = this.oK2Connection.OpenWorklist(crit);


....


 

6 replies

Forum|alt.badge.img+6
  • April 15, 2008

Hi there,


Really not sure if it will help, but have you tried doing the same but using WCLogical.Or instead of the And.. just a stab in the dark for now.


Also have you made sure that the logged on user does receive work list items when you have no worklist criteria specified? And have you checked (perhaps through the reports) that the DealerCode process data field contains the correct value at the point in the process instance?


 


Forum|alt.badge.img+1
  • Author
  • April 16, 2008

I try using the WCLogical.Or, but still return empty. If I don't add this filter Criteria, I can get the disired worklistitem, and the ProcessDataField value is correct.


If I replaced with below:


crit.AddFilterField(WCLogical.And,WCField.ProcessData,"DealerCode",WCCompare.NotEqual,dealerCode);


then will return all the Worklistitems which include the aimed WorklistItem. So it's very strange.


Forum|alt.badge.img+4
  • April 16, 2008

Hi all,


The WorkListCriteria is not up to scratch at this point. Johnson, what you are trying to do with the 'WCLogical.And' is exactly the same we got. It was fixed and will be included in a fix that will be released in the near future.


Cheers,


 


Forum|alt.badge.img+1
  • Author
  • April 16, 2008
Thanks for your testing and reply.

Forum|alt.badge.img+4
  • April 23, 2008

Hi I saw a KB article from K2 portal site addressing Worklist Criteria bug:


 http://kb.k2workflow.com/Articles/KB000218.aspx


There is a patch associated with it.


Please contact a local K2 consultant if you do not have accesss to the KB site.


Hope it helps.


Regards


m


Forum|alt.badge.img+3
  • August 4, 2011

For me this worked:


private static WorklistCriteria SetupWorkListFilter(int pageNumber)
        {
            //Add the default K2 worklist filters as per k2 webpage worklist
            WorklistCriteria k2WorkListCriteria = new SourceCode.Workflow.Client.WorklistCriteria();
            k2WorkListCriteria.Platform = "ASP";
            k2WorkListCriteria.Count = _numberOfPageItems;
            k2WorkListCriteria.StartIndex = pageNumber * _numberOfPageItems;
            k2WorkListCriteria.AddFilterField(WCField.WorklistItemStatus, WCCompare.Equal, WorklistStatus.Available);
           
            k2WorkListCriteria.AddFilterField(WCLogical.Or, WCField.WorklistItemStatus, WCCompare.Equal, WorklistStatus.Open);
            k2WorkListCriteria.AddFilterField(WCLogical.And, WCField.WorklistItemOwner, "Me", WCCompare.Equal, WCWorklistItemOwner.Me);
            k2WorkListCriteria.AddFilterField(WCLogical.Or, WCField.WorklistItemOwner, "Other", WCCompare.Equal, WCWorklistItemOwner.Other);
            k2WorkListCriteria.AddFilterField(WCLogical.And, WCField.ProcessData, "SearchFilter", WCCompare.Like, "*test7*");
           
            return k2WorkListCriteria;
        }


 


Where SearchFilter is a standard string Process DataField. I put test6test7test8 in the field and it works.


Equal also worked if I put "test6test7test8" in the value parameter.


Gabor