cancel
Showing results for 
Search instead for 
Did you mean: 

Want user to choose executors for further multiinstance usertasks

bpmn
Champ in-the-making
Champ in-the-making
Hi. I want user in first usertask to choose multiple users as assignees of second multiinstance usertask. Is there a way to do it?
Now I can do it by setting a variable in task listener and then use this var for setting assignees like that

            List<String> approvers = new java.util.ArrayList<String>();
            approvers.add(orgOD.getHeadOrg().getChief().getUUID());
            approvers.add(orgMTO.getHeadOrg().getChief().getUUID());
            approvers.add(orgFin.getHeadOrg().getChief().getUUID());
            runtimeService.setVariable(delegateTask.getProcessInstanceId(), "approvers", approvers);

But i need to do it via forms. I found that submitFormProperties takes only string properties.  But later it uses org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(String variableName, Object value) to set a resulting variable.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Good start could be "Employee productivity" process (report) in activiti explorer. There is a form with one user selection.

Regards
Martin

bpmn
Champ in-the-making
Champ in-the-making
I'm not using activiti explorer. I am using my own form and can pass any type of list from this form, but I do not know how activiti can take it. It seems it can take only String.
Actually, I have already done it by embedding the type of data I need and a name of variable to set into the form property id. Then I am parsing the property id and setting variable with List<String>, then submitting form without exit values. But it looks ugly.

jbarrez
Star Contributor
Star Contributor
If you use your own forms, better not use the formservice but simply the complete that takes in a hashmap of variables