Tuesday, October 22, 2013

Build Collections for Composite Task

For a Composite Task you need to define executors and set AssignedTo field. This field has a specific type InArgument<Collection<string>>. So you need to build a collection of strings and specify it to Composite Task activity. Let's take a look.

You can see the AssignedTo parameter:

  For setting it you should take BuildCollection activity and choose a string type:

Then create a workflow variable of InArgument<Collection<string>> type called Executors

and set it Values as shown:


where values has claims-like view "i:0#.w|DOMAINNAME\\user". Then set a CompositeTask AssignedTo field to Executors.

Similar to that, you can grow a Dictionary by BuildDictionary activity. 
For the <Dictionary<string, string> case note that keys set as text, but values are need to be directly set as C# strings:


  1. hi it is really a valuable information. What if i want to pass the SP group dynamically

  2. Based on your example if i give Executors, the approval goes only to the first person and not the second. Can you guys help me out

    1. Hi!

      If you want to set SP group dynamically, you need to create your custom web service or a code activity, which would return the Collection<string> value.

      Then create argument of in-direction in workflow designer (in-argument), with type of Collection<string>, set this argument with your web service or activity value, and then this InArgument<Collection<string>> will be your AssignedTo value.