How to programatically access the destination rule in a certain activity ahead of time?


Badge +11

How to prgramatically access the destination rule in a certain activity before we reach that activity.


6 replies

Badge +5

It's impossible to access the destination rule unless you are within the context of that activity.


this is how K2 blackpearl works by design.

Badge +11

thanks alot 7abeeb 2lbi.


it's nice to notice that some brothers master k2.

Badge +9

Yousef is correct about technically not being able to "look ahead" at a destination rule. However in cases where I've needed to do something like this, I have used a SmartObject to return a set of users that are then used in the Destination Rule of that specific activity.  This then allows me to invoke this SmartObject from anywhere in the process.

For example...  I create a smartobject called "MyUsers" that exposes a property called UserName (that is a DomainUserID).  This SmartObject can be a SmartBox, SharePoint....).  In my activity destination rule, i invoke the GetList on this SmartObject and leverage the UserName property as the basis for my Destination Rule.  K2 is intelligent enough to determine that this is a List of usernames and will assign the tasks accordingly.  If in earlier parts of the process i need to know who would be assigned the tasks at a specific step, i can then simply invoke the same SmartObject method. 

 

HTH.

Badge +11

Dear Bob


is there a walk through to show me how to do this; the idea of having a smart object that interacts with destination rules and workspace roles is hard to imagine. can you support one?

Badge +8
I'm also Interested..can u share a demo??
Badge +5

Gents, refer to this blog for this topic http://blogs.inobits.com/Yousef/post/Getting-Role-Users-from-a-SmartObject-method.aspx

Reply