User Task Escalation

There is a scenario where an User Task is to be escalated Multiple Times to the immediate supervisor of Assigned User.

e.g. There is an User Task with SLA 10 Min. If assignee doesn’t completes tha task in this time it will be escalated to their Immediate supervisor and again if supervisor user doesn’t complete their task in next 20 min. this task will again be escalated to next level supervisor and it can again be esclalated further to next su.pervisor. Just mean to say multilevel escalation of User Task

What is the best way to design the BPMN to achive the same.

Thanks in Advance !

@PrashantD I would probably look at something like this

Where you escalate, and if you need to escalate further you are just using a call activity to “endlessly” create a new instance of the same escalation process definition

@StephenOTT

Thanks for prompt response.

It is a good idea using call activity here.

In my case we are creating BPMN programmatically using Fluent Builder API based on Step Configuration i create UserTasks either parallely or sequentially and deploy generated ModelInstance using repositoryService.createDeployment() method. Creating multiple BPMN and deployment will not be easy for me. Also call activity always creates new ProcessInstanceId we will have to handle that. Here we create dynamic workflows for multiple client and handle generically.

In above approach after last escalation process will end. Here what we do is at each user task there can be multiple escalations in sequential manner as described above. At any escalation step if task completes it will connect to next user task of parent sequence. Here only assignee is getting changed. Please provide some other way .

Not accurate but attached bpmn will clear. It would be great if provide best way to model tha same.
escalation.bpmn (12.1 KB)

@StephenOTT Any help ?

Hi @PrashantD,

what about this: https://cawemo.com/share/188a53a1-0266-4e0e-b821-380697f6fa7a

If the fluent model API is not sufficient to achive it, try the conventional way: https://docs.camunda.org/manual/latest/user-guide/model-api/bpmn-model-api/create-a-model/#example-2-create-a-simple-process-with-two-parallel-tasks

Hope this helps, Ingo

1 Like

@PrashantD the model i gave you still works. You just need to make your escalation process a “configurable” process using expressions: so each variable: the timer, assignee, task name, etc, is a expression. When you call the Call Activity, you use the Input Mappings of the Call Activity to inject your data.

You can track the creations of the instances of the processes using the ProcessProcess connections, or use something like a BusinessKey or common variable (like a case id)

In the fluent api, you ~might be able to create a instance of the call activity manually, and then inject that into the BPMN instance after you generate the basic structure using the fluent api. Take a look at this code: Adding Extensions Properties to Model with Fluent API (Helper Example) as a possible example to start from. THis was for adding extension properties to a existing element, but might be similar scenario.

@Ingo_Richtsmeier’s way also works well: again use expressions for the Timer and the assignee, and you can make your single task configurable using scripts and expressions. Each time the timer executes, it just getting the data to re-eval the user task for its next iteration

1 Like

Hi @Ingo_Richtsmeier,
Thanks for your response!

What if we use mutiple timer events for every escalation and set assignee in ExceutionListener attached at timer event some thing like this. 

Job timerJob = managementService.createJobQuery().processInstanceId(execution.getProcessInstanceId()).activityId(execution.getCurrentActivityId()).singleResult();
Task task = taskService.createTaskQuery().executionId(timerJob.getExecutionId()).singleResult();
String manager = “xyz”;//by some logic
task.setAssignee(manager);
or
taskService.setAssignee(task.getId(), manager);

Using varibales for time and assignee always have to identify in atatched sequence flow to which userTask we are going to connect as every workflow is dynamic.we get all metadata of a task when task is created.escalation.bpmn (8.4 KB)

Thanks in Advance!