UserTasks handling

Hi
I have a question about userTaskhandling. Currently I’m using Flowable like that;

  1. Start process
  2. Find UserTask for current user with created processInstanceId Task task = taskService.createTaskQuery().processInstanceId(id).userAssignemt(user).singleResult();
  3. For finded UserTask show custom form associated with taskId
  4. Complete UserTask taskService.complete(task.getId());
  5. Go to 2

There are some problems with above apprach

  1. What if we have proces like UserTask1->Script(asynch)->UserTask2 then we don’t know how long waits for UserTask2 to appear…in heavy load enviroment the execuotrs with 8 threads could execute script in 5minutes - this could be resolved by changing script to synch
  2. What if we have proces like UserTask1->SubProcess->UserTask3 and in this SubProcess we have UserTask2

How you resolve these situation? Do you have step by step process when users are guided what to do or maybe each user action return to task list. And user have auto refresh list and waits for next task assigment to him

Hi @MirekSz

You get all the tasks for a certain process (and its sub-process(es)) with this query:

List<Task> result = taskService.createTaskQuery().processInstanceIdWithChildren("your-process-instance-id").list()

I would redirect the user to a task list if you have some async activities in the process, because you do not know how long the async activities take.

I hope it helps you.

Regards,
Simon