Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically setting user task assignee

Tags:

activiti

I have to create process in activiti which requires the following use case.

1.The form has a people search field 2.When someone completes the form and completes the task with a people search field filled with names,I need to set the next task's assigned with the name/names as users who can take action on the next task.

How can I achieve using the activiti engine apis.

any help on this is appreciated.

Thanks in advance.

like image 579
sathishvisa Avatar asked Oct 08 '13 17:10

sathishvisa


1 Answers

You can use following steps:

  1. Pass input user value from your html form to Activiti using taskService.complete(task.getId(), taskVariables); taskVariables should contain variable with keys for example 'userId' or 'userIds' to access submitted values in process instance
  2. Use expressions in your process definitions <userTask id="task" name="My Task" activiti:assignee="${userId}"/> or <userTask id="task" name="My Task" activiti:candidateUsers="${userIds}"/> to assign tasks

    Also look to http://www.activiti.org/userguide/#bpmnUserTask and http://www.activiti.org/userguide/#springExpressions for detailed information
like image 59
ATMTA Avatar answered Nov 15 '22 16:11

ATMTA