title: How do I pass a list of candidate users to an activiti workflow task in alfresco?
body: <p>I would like to be able to pass a list of users as candidates for a task. The users are retrieved from a data list and not available as a group. Activiti:candidateUsers would appear to be the right approach.</p>
  
  <p>Assuming that the users have been obtained and set in the variable, ipw_reviwers.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;serviceTask id="alfrescoScripttask1" name="Alfresco Script Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate"&gt;
    &lt;extensionElements&gt;
      &lt;activiti:field name="script"&gt;
        &lt;activiti:string&gt;logger.log("IPW - setup task");
        execution.setVariable('ipw_reviwers', "tom, dick, harry");&lt;/activiti:string&gt;
      &lt;/activiti:field&gt;
    &lt;/extensionElements&gt;
  &lt;/serviceTask&gt;
  </code></pre>
  
  <p>The following to uses the variable ipw_reviewers</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;userTask id="adhocTask" name="Adhoc Task" activiti:candidateUsers="${ipw_reviewers}" activiti:formKey="wf:activitiReviewTask"&gt;
    &lt;extensionElements&gt;
      &lt;activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"&gt;
        &lt;activiti:field name="script"&gt;
          &lt;activiti:string&gt;logger.log("IPW - create task");
          if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                    if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;&lt;/activiti:string&gt;
        &lt;/activiti:field&gt;
      &lt;/activiti:taskListener&gt;
    &lt;/extensionElements&gt;
  &lt;/userTask&gt;
  </code></pre>
  
  <p>No one is able to see or claim the task. If there is only one user in the list, that user is able to claim the task.</p>
  
  <p>If activiti:candidateUsers is declared as</p>
  
  <pre><code>activiti:candidateUsers="tom, dick, harry"
  </code></pre>
  
  <p>then all three users are able to claim the task.</p>
  
  <p>Can a list of users be passed to activiti:candidateUsers in a variable or should a different approach be used?</p>