-
1. Re: Dynamically assigning users to tasks in a web application
buenavida Aug 25, 2014 2:34 AM (in response to bhahan)You can create your own UserGroupCallback like in this example. Then you have to create your environment with you usergroupcallback implementation like this:
UserGroupCallback userGroupCallback = new MyUserGroupCallback();
RuntimeEnvironment environment = runtimeEnvironmentBuilder
.userGroupCallback(userGroupCallback)
...
.get();
If the actor field in the bpmn2-file is empty, you can use getTasksAssignedAsBusinessAdministrator("Administrator", "en-UK") of TaskService to get this task.
After you get this task you can use the delegate methode of TaskService to assign this task to a user:
taskService.activate(taskId, "Administrator");
taskService.claim(taskId, "Administrator");
taskService.delegate(taskId, "Administrator", "username");
Have also a look at this examples.