8

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.

sathishvisa
  • 315
  • 1
  • 5
  • 16

1 Answers1

10

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
ATMTA
  • 767
  • 6
  • 18