Skip to main content

One of blackpearl's features is the ability to dynamically add users to the Destination Role using a string representation of their username.  Blackpearl will then resolve the username, prepending the security label and domain to fully qualify each user.  See Ockert's post for more info (http://k2underground.com/forums/post/18496.aspx).


Roles can be bound as destinations; however, the actual Role must be bound.  If you try and pass a string containing the Role name as a destination user, blackpearl will treat the string as a username, not as a Role.  One solution to get around this is to resolve the role using the APIs at the code level.  However, there is another way to accomplish this by using the Destination Rule wizard in advanced mode. 


To start, you will need to setup Roles in blackpearl.  I will be using 3 roles, WesterRegion, EasternRegion, and CentralRegion.


Roles Used for this example


Also, we will need a location that will store the Role name in a string format.  This can be a Smart Object parameter, Activity or Process level Data Field or XML Field, or any other location that can hold a string.  For this example, I'm using a Process level Data Field named DynamicRole.  I set the default value to be "WesternRegion"


Process level Data Field


Once Roles have been created and a field is available to store the string name of the Role, it's possible to start configuring an activity's Destination Users.  The following steps will walk through configuring the Destination Users to accept a string containing the name of a Role and assigning the task to the users in that role.



1.  Click the Destination Rule icon on the Client Activity in which you want the Roles dynamically assigned based on the role name.


Destination Rule Icon 



2.  When the Destination Rule wizard displays, click the Back button. This will take you to the wizard's welcome screen.


3.  Check the Run this wizard in Advanced Mode box. This will allow for greater configuration of the Destination Rule.


Advanced Mode



4.  Click Next


5.  Select your Destination Rule Options. For this example, keep the default (Plan just once). More information on these options can be found in the installed blackpearl documentation. Search for Destination Rule, Advanced Mode.


Activity Planning



6.  Click Next.


7.  Select the slot rules for your activity. Make sure that "Resolve all roles to users" is selected.


Slot Planning



8.  Click Next.


9.  Click Add to create a new Destination Set.


10.  Enter a name for the new Destination Set. I will use WesternRegionSet as my name.


11.  Click Add. A new row will be created.


12.  Click the ellipses button next to the new row.


13.  Select the Role from the Context Browser that will be resolved for the current Destination Set.  This will bind the role with this set, which is what we want.  Since I am configuring my WesternRegionSet, I will select the WesternRegion Role.


Context Browser Roles  



14. Click Add.  The Destination Set screen should look as follows:


Binded Role



15.  Click Next.


16.  Click Add to create a new Destination Rule. The Destination Rule editor will display.


17.  Click the ellipses button next to the First Variable box. When the context browser opens, select the field that contains the Role name and click Add.


18.  Choose = from the Comparison Operator drop down list.


19.  Type the name of the role, as it will appear in the field, into the Second Variable textbox. Quotes are not needed. Since I assigned the string "WesternRegion" as the default value for my DataField, I entered WesternRegion as my text in the Second Variable textbox.


Destination Set Rule 



20.  Click OK.


21.  The Destination Set Rule screen should look as follows:


Set Rule Completed



22.  Click Finish.


23.  Repeat steps 9 - 22 for each Role that can be dynamically assigned. Since I had 3 Roles, I repeated these steps two more times, once to bind the CentralRegion and once for EasternRegion, resulting in 3 distinct Destination Sets.


Multiple Destination Sets 



24.  Click Finish, completing the Destination Role wizard.


If we build, deploy, and run this process, the role will be correctly resolved to its assigned users.  Each user should now get a notification that they have a new task as well as a new item appearing in their task list.  Depending on the options chosen in step 7 & 9 will determine how the task is completed and how many destination users must respond to the activity.


Note:  If a value comes through that is not setup as one of the destination rules, the activity instance will error out since there are no destination users assigned to it.  When this happens, the instance will appear in the Error Logs.

Be the first to reply!

Reply