cancel
Showing results for 
Search instead for 
Did you mean: 

setting Pooled Actor problem

mangar
Star Contributor
Star Contributor
I am using activiti and I am trying to assign a task to a list of actors.  I have them in a String[].  I am trying to launch them in a web script.  I set my vars like this:


Map<QName, Serializable> vars = new HashMap<QName, Serializable>();
vars.put(WorkflowModel.ASSOC_PACKAGE, wfPackage);
vars.put(QName.createQName(AlfrescoModel.WORKFLOW_NAMESPACE,"assignee"),array);


the variable "array" is the String[]

my task def looks like this:


   <userTask id="usertask1" name="my start task" activiti:candidateGroups="${jiswf_assignee}" activiti:formKey="jiswf:myTask">


I get an error saying "Caused by: org.activiti.engine.ActivitiIllegalArgumentException: Expression did not resolve to a string or collection of strings"

how Do I get a task assigned to a group of people without actually creating a group.  What am I doing wrong?
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
If you are dealing with multiple users you need to use "assignees" instead of "assignee".


vars.put(QName.createQName(AlfrescoModel.WORKFLOW_NAMESPACE,"assignees"),array);

That did not work. It did not throw an error but no tasks were assigned to anyone.

Also does assignees assign a task to each individual user, or is it a pooled situation?

Does anyone have an example of how to set an ad-hoc String[] of users a pooled task?  both how to set it in a web script and how the user task would be defined.

Im so desperate.

mangar
Star Contributor
Star Contributor
ok,  If I set my task to look like this:


   <userTask id="usertask1" name="my start task" activiti:candidateUsers="${jiswf_assignee}" activiti:formKey="jiswf:myTask">


and sent in my webscript user list like this:


  String s = "user1, user2, user3";
  vars.put(QName.createQName(AlfrescoModel.BPM_NAMESPACE,"assignee"),s);


it works just fine, but I know that this is not "correct"
I want to send in an Array or String[] or something.

I have tried bpm_assignees, bpm_pooledActors, sending in List<String>  String[]  any and all combos.

I either get Not Serializeable exception (Which makes NO sense for a List<String>)

How is this to be done?  A specific example would be greatly apreceated.