Activity level datafields


Badge +1
Currently our processes have line rules that contain similar logic, one line rule is followed when the logic is True and the other for False. Can we use temporary datafields at the activity level? It seems more efficient to me to have the logic in a single location, like in an event at the activity level. Then, the activity's event can set a value into a datafield at the activity level. Then it would be nice for the line rules coming out of the activity to be able to look at the activity's datafield to determine the workflow's course.

Can this be done? If so, could someone please post code showing an event setting a value to an activity's datafield and more code showing a line rule accessing an activity's datafield?

4 replies

Badge +13
Yes it can be done.

For looking at activity data in line rule, you can use the GUI tool and pick the activity field (then generate code if you need to).

However be ware that server events preceding client event will fire once per destination user.

If you have all server events, that'll be fine, or if you have server event AFTER client event, that'll be fine also.
Badge +1
But with the GUI tool when I go to add a new rule, I only have the following choices for the first variable: K2.Activity.Count, K2.Activity.Status, and K2.Activity.User. Should there be something for datafields?
Badge +9
Click the "..." button to the left of the drop down list that contains the 3 entries you noted. Once you click this, you should be presented with the "K2.net Data Viewer" dialog. This will allow you to select from String Table, Process Data/XML fields and Activity Data/XML fields and create your Line Rule logic accordingly.
Badge +9
Opps, I meant to say "... to the RIGHT", not the left.

Sorry.

Reply