once we try to use a parallel gateway (where a token gets multiplied itself) we immediately get an error whenever a following user task uses a UserProvider which relies on the fact that current execution (i.e., token) already exists in the Flowable engine. But turns out this is just not the case. Only the original (pre-gate) execution exists or even no execution exists whatsoever, like in the test case.
A working project to play with (courtesy of @8pade8) https://github.com/8pade8/UserProviderTestCase, see README.md for details, but actually you just have to run project, login the app and start the only process.
Currently we use a gory workaround based on signal catching before each user task and an additional branch just for signal throwing after some timeout.
Seemingly, this is the only way to access process definition & task definition objects, let alone execution variables. The sample from docs relies on execution id as well: String userLogin = (String) bprocRuntimeService.getVariable(executionId, "userLogin");.
Ups, I was wrong regarding process variables - they work well indeed, but they couldnât reveal which task exactly is asking for their candidates. If we have two tasks how can we draw a line between them?
Do you mean that a provider should return a different set of users depending on the task name or task id? Wonât it be better to have two separate UserListProviders then?
If you really need to have one place where the assignment is done and analyze the task name there, then you may try to do the assignment with a TaskListener (see Flowable documentation). Youâll have an access to the DelegateTask object there and also youâll be able to configure your task listener using the fields.