Complete 1 of N Pattern
This design pattern allows the creation of various tasks, only one of which can be completed.
It works similarly to an event-based gateway with tasks instead of events.
There should be never more than one user task.
Otherwise, it can happen that users work on different tasks at the same time, but only one can complete his/her task, meaning that the work of the others was in vain.
Viewed in isolation, the pattern does not seem very useful, but it can still prove to be a useful building block.
First, we create a sub-process so that we can simply consume tokens without affecting the rest of the process.
The parallel gateway generates a token for each of its outputs, which then waits at the respective task.
After completing a task, all tokens in the sub-process must be destroyed immediately afterwards (same transaction), otherwise it would be possible to complete more than one task.
This is done either with a terminate end event, after which it continues normally (happy path) or with interrupting boundary events, which catch the errors or escalations thrown by the end event in the sub-process.
With different escalations or errors, separate outputs can be defined in order to react differently depending on which task has been completed.