Skip to main content

Hi everyone,

I'm looking for a way to dynamically set multiple destination users/groups of a (single) activity. Activity destinations are stored in external database.

I've found a solution to this problem for K2.2003 workflow HERE but I believe that the solution is not Blackpearl compliant ( I couldn't find Main(ref DestinationRuleContext K2) method).

 

So, my question is where should I put the code that will load activity destinations ? Should I modify DestinationRule_ExecuteCode method in DestinationRule or should I call load method from somewhere else ?

 

 Thanks,

 Kruno

 

What I've done in the past is load an xml string of user accounts that can be assigned the task, putting this xml value into an xml value within the process.  Then, in the destination rule of your activity, assign it to the xml field and it will be assigned to all of them.  I realize I am being a bit vague, I hope it at least points you in the right direction.  If not, I will try and write up some more specifics.  Good luck!

Hi Tim,

Thank You for Your answer. I understand the idea, but I need a bit more help.

I created a process XML field and set the initial value:

<userAccounts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/userAccounts.xsd">
  <userAccount>K2:Denallix
yan</userAccount>
  <userAccount>K2:Denallixadministrator</userAccount>
</userAccounts>

Using Activity Destination Rule wizard I added a new destination with <userAccount> node as value. 

The problem is that when I start the process only the first user (K2:Denallix
yan) gets the task. I thought that K2 will automatically add all users in a list as destination users.

Do You know what could be the problem ?

Perhaps I have to put all users into the same node delimited with some character like ';' ?

 

Best regards,

 Kruno


Try this - in the Destination Rule wizard, back up the screens until you can select 'Advanced' mode.  When in advanced mode, check off that you want to 'plan per destination' - 'All at once' and see if that helps.


Hi Tim,

No, it didn't help, and as I am short on time I decided to solve my initial problem by coding the destination rule. It's an ugly solution but it works. :)

Thanks anyway,

Kruno


Hello ,


 It might be to late but a nice way of doing this would be to create a SmartObject of your destination user for that activity and create a GetList method that get the list of all user in that database table. You will need to get the SQL dynamic service Object to be able to connect to the DB table first.


Then use your smart Object get list method in the destination rule of your activity.


Regards


Adrien


 


I am sorry to hear that it didn't work, if you have time to revisit this in the future, please post back here and we'll try to work it out.  I am definitely interested in seeing how you are accomplishing this as well as exploring alternatives (such as using a SmartObject, as someone else suggested).
I'm having this problem as well.  I have a form that queries a sharepoint list for destination users.  When a user selects a name from the list it automatically populates the Username field w/ the select account's username.  Then I go into K2 and set the destination user to the repeating field "Username" but the activities are only assigned to the first name in the list.  Interestingly I have a K2 VPC image which appears to be SP1 and it works fine while my dev server is 0803 and it isn't working.  If no one has any ideas on this I'll open a ticket w/ K2 support.

I'm experiencing the same behavior.  I can see in the XmlData that the field has the correct value with multiple users, but with build 803, only a single user ever receives the worklist item.  I'd like all the destination users to see the worklist item and have it drop off their worklist when it's been actioned by any one of them.

My settings:

- Plan per destination (All at Once)

- Specify the number of slots (1)

- Resolve Roles to users


We tried out both using the above mentioned hard coded fields and also a repeating field from an InfoPath form and it worked fine in both 0803 and 0807 (pre-release).


For the InfoPath steps, essentially I followed this nice article.


http://k2underground.com/blogs/fromthebench/archive/2008/05/22/activity-destination-users-based-upon-a-repeating-xml-element.aspx


Well thank you for the link...i work it out yesterday.


the node you are picking must be a repeating node........!!


 


 


I wanted this to work with ASP.NET (not InfoPath) and stumbled into the solution. I've documented how to get it working in this post. http://merill.net/2010/06/dynamically-setting-multiple-activity-destinations-in-k2-with-asp-net/


Reply