Skip to main content

How do i access "activity datafields" in Blackpearl destination rule written using custom code.


Following line doesnt work in DestinationRuleContext.


K2.ActivityInstance.DataFields["Activity datafield name"].value


 


Blackpearl is installed on server machine and I would like to debug from client machine where VS 2010 is installed and where blackpearl process is being developed.

I don't think you would/could use k2.ActivityInstanceDestination.DataFields in DestinationRuleContext.   You can use it after the destinations are set in the server event of the activity.


I wanted to use activity variable defined with name "Reviewers" in each activity, so that i could pass its value from .NET code, which will be comma separated NT ids. These ids will be added as destinations using code.


I can use processinstance datafield for same, and its working. But thought to make it clean and reusable activity, i should define destinations from activity variable. Is it possible ?


I think you're going to run into problems if you do it that way. The destination rule lives on the activity, not the event. The activity level data fields are only created when the activity is created, and you can't use activity level data fields for the destination rule because they won't exist yet.


I'm writing this off the cuff so I may well be wrong... terms and conditions apply :)


Reply