WorkItem DataFields Problem

  • 27 November 2008
  • 2 replies
  • 0 views

Badge +1

Hi guys, I'm having a problem getting the ProcessInstance Datafields from the WorkItem (I'm using the Workflow.Client dll)


I have a process with a number of Process DataFields... and I need to access those values from the client...


Code:


SourceCode.Workflow.Client.

Worklist wslist;


wslist = oConnWI.OpenWorklist();




foreach (WorklistItem wsi in wslist)


{


  string Type  = wsi.ProcessInstance.DataFields["Type"].Value; //ERROR IS THROWN, STATING THE DATAFIELDS COLLECTION IS EMPTY, WHICH IS FALSE...


... etc


}


This tells me that there are no DataFields...but they are. as I tested with the OpenProcess (but, as an administrator)..


What could be happening? I really need your advice here. Should I change anything in the definition of the Process Fields?


Kind regards, and thanks in advance...


2 replies

Badge +1

This solved my issue:


(Adding a Item.Open();) before reading the value..


http://www.k2underground.com/forums/permalink/23896/23915/ShowThread.aspx


(Thanks Mark) 


 

Badge +6

Hi,


What version of blackpearl are you using exactly (including patch)? on the 0803, their was an issue fixed bu the following patch http://kb.k2workflow.com/articles/kb000257.aspx. The method you are using to view the data works but it's not a good thing regarding to performances (multiple unuseless called to the K2 server are done in that case). So please applied the patch or maybe it's a design issue (is the "data on demand" checkbox checked on your datafields?).


HTH

Reply