Skip to main content

Hi,

I have a situation in my workflow that due to branches make the usage of some process datafields difficult because they are global and i would rather need to have some values defined per activity.

If i create datafields in activities instead of process is it possible to access them through code between Activities?

If i define a DataField named "myData" in Activity1 and then in Activity2 i put a server event can i access this DataField or can i only see the DataField within the scope of Activity1?

By the way what is the difference between doing in Activity1:

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

and

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

to access the datafield value?

 
Thanks
 

Activity datafields only exist for the duration of the activity.  You cannot reference the activity-level data fields outside of the activity.


For your second question:


K2.ActivityInstanceDestination.DataFieldss"myData"].Value


is a data field associated with the current slot in the current activity whereas


K2.ActivityInstanceDestination.ActivityInstance.DataFieldss"myData"].Value


is a datafield associated with the activity, regardless of slots.  How do you create one versus another?  When you create an activity-level datafield, check the Shared checkbox to create a datafield for the whole activity; leaving it unchecked creates it per slot.


Reply