DataFields in Blackpearl

  • 1 May 2008
  • 1 reply
  • 0 views

Badge

WE are converting an applciation to blakcpearl from k2 2003 and we are having some problems when using the SourceCode.Workflow.client (instead of k2rom).


It seems to behave differently when accessing the datafields though we are using code similar to what is given in the k2[blackpearl] developer reference.


We are trying to access the datafields through a worklistitem however the count is always 0 (worklistItem.ProcessInstance.DataFields.Count)


If I Open a process instance (using the worklistItem.ProcessInstance.ID) the datafields are there.


The k2[blackpearl] developer reference shows code accessing the process instance datafields from a worklistitem so it looks like it should work?


1 reply

Badge +9

Are you using the most recently release (0803)?  If so, the underlying worklist retrieval functionaly was changed to not retrieve datafields (for scalabiltiy/performance), however I don't believe the Developer's Reference for that specific article was updated. 


In order to retrieve the data fields for a specific worklist item, you will need to open it:


            worklistitem.Open(false);


The parameter in this version of the Open method determines whether or not the task should be allocated.  Setting it to false means that the retrieval of these datafields will not cause a change in status on the worklistitem.


Once you have executed the Open method you should have access to the Data/XML fields.


HTH.

Reply