How can we retrieve the datafields values for a previous Activity for a certain process instance

  • 12 January 2011
  • 4 replies
  • 3 views

Badge +11

Dears


How can we retrieve the datafields values for a previous Activity for a certain process instance?


using APIs or from the database?


4 replies

Badge +4

Datafield values are maintained throughout the process intance. During the various activity you can edit and manipulate the values of the data fields. What do you mean by previous activity datafield value.  You can have multiple field eg. activity1Datafield, activity2datafield and store the value according to the activity and read at any time. You dont have access to the finished activity.


int CustomerId  = (int)K2.ProcessInstance.DataFields["CustomerId"].Value;


At the end of the activity you read the activityresult and accordingly you can manipulate the values. That is it, after that you dont have the acces to the previous activity.


Regards


NathanPillai

Badge +4

You can use the following command to get the activity level data fields.


K2.ActivityInstanceDestination.DataFields["CustomerId"].Value    (From the current slot)


or


K2.ActivityInstanceDestination.ActivityInstance.DataFields["myData"].Value


Regards


Senthilnathan

Badge +11

Example


a process has three avtivities: Actv1, Actv2, Actv3. it also has one datafield: Dtfld1


on each activity the datafield value is updated.


imagine that Now i am at Actv3; Can i by any means know what was the Datafield value when it was at Actv1 or Actv2.


 

Badge +11

 Can i by any means know what was the Datafield value for previous Activities.

Reply