Dynamic destinations

  • 22 July 2009
  • 7 replies
  • 0 views

Badge +1

We're attempting to run a workflow that will pull it's list of destination users from a moss list.  We've got a smart object that lets us access the list,  which we iterate over early in the workflow and concat the users into a single workflow data field:

 

   pUsers = pUsers + String.Format("K2:{0},", property.Value);

 

The Activity where we use this data field is set to create a slot for each destination, Plan per destination - All at once.  Create a slot for each destination and resolve all roles and groups to users.  The destination set is pulling in the workflow data field and treats it as a user.  The problem is that the activity will hand on this step and will not assign any tasks to the users.  Can anyone tell us what we're doing wrong here?

 

 


7 replies

Badge +8

Hi Chris,


If you use a Process Datafield in a Destination, it must contain a single valid user-id.


K2 does not validate or parse the contents of the Datafield when it creates the Worklist Items. You can for example have "somethingcrazyman_in_the_moon" in your DataField, and K2 will create a Worklist Item for "somethingcrazyman_in_the_moon" without throwing an error.


May I ask, why don't you just use the SmartObject directly in the Destination Rule? If you have a 'Single Line Text' type SP Column which contains user-id's, this will work like a charm.


Another option is to store the Destination Users in an XML field with a repeating node, Bob explained this very well here: http://k2underground.com/blogs/fromthebench/archive/2008/05/22/activity-destination-users-based-upon-a-repeating-xml-element.aspx


 

Badge +1
I hadn't seen that article before, but I'll give it a try.  Thanks!
Badge +1
Your suggestion of using the smart object worked like a charm.  Thanks!
Badge +2

Will using smartobject work when I have People or group field instead of text field? I suppose not because of the format of this field...

If using smartobject as a text field - what should I choose in dropdown:  User or Group?

If using smartobject as a text field - can I have userIDs mixed with AD group IDs???

 

Any help will be really appreciated :)

Anna

 

Badge +2

Hi again,

I have a text field with user logins in format : domainuser,domainuser2.

I have a smart object, I assigned destination to this field. 

Activity is created and as destination it has this text field but task is not assigned to any listed users. Any ideas how to make this field format able to be resolved by K2? Any additional advanced destination settings has to be set?

Any help would be appreciated,

 Anna

 

 

 

 

 

 

Badge +1
The smart object we were using used a Person field which worked fine.  I would think that the mixing of groups & users might work provided you checked the resolve all users and groups to roles option.
Badge +2

Hi Chris, can you explain a bit more how did you make it work?

Best regards,

Anna

Reply