Stringlist parameter pass to Context.StartWorkflow

How should the stringlist parameter be passed to Context.StartWorkflow in the proper way? I have tried:

participants=@{Context["participants"]}
participants=@{java.util.Arrays.asList(Context["participants"])}
1 votes

1 answers

2548 views

ANSWER



Hello,

If you want to put a list like for instance a NodeVariables[“assignees”], You can do this:

  • Set Context Variable name: participants value: @{new java.util.ArrayList()}

  • Run Script script: java.util.Collections.addAll(Context[“participants”], java.util.Arrays.asList(NodeVariables[“assignees”]));

Using Collections.addAll method.

Hope it helps

0 votes



Hello, Thank you for your response, but the problem is that in the StartWorkflow operation the participants variable is passed as the operation parameter. In consequence list is treated in a different way. All the best
12/02/2014

Can you give me your complete use case?

Can't you use a context variable to assign to your parameter?

12/02/2014

This is an example:

  <operation id="Document.GetUsersAndGroups">
    <param type="string" name="permission">MailingListPermission</param>
    <param type="string" name="variable name">varMailingList</param>
    <param type="boolean" name="ignore groups">false</param>
    <param type="boolean" name="prefix identifiers">true</param>
    <param type="boolean" name="resolve groups">false</param>
  </operation>

  <operation id="Context.StartWorkflow">
    <param type="string" name="id">xxxWorkflowReview</param>
    <param type="boolean" name="start">true</param>
    <param type="properties" name="variables">expr:mailinglist=@{Context["varMailingList"]}
    </param>
  </operation>

Lists as "varMailingList" can be many.

12/05/2014

Hi,

The param "properties" of Context.StartWorkflow is Properties type.

org.nuxeo.ecm.automation.core.util.Properties is extending HashMap<String,String> and not a list.

For instance: <param type="properties" name="properties">dc:title=MyDoc</param>

Hope it helps.

01/12/2015