Triggering task assignment expressions

Hi, in my project we are assigning multiple task via different delegate expressions ${myDelegate1.getAssignee(execution)}, ${myDelegate2.getAssignee(execution)} etc.

Now due to some business data changes all tasks need to be reassigned, the logic of delegates need to be evaluated once again for all tasks. How can I archive that?

(I don’t want to cancel activity and start it over, since this will trigger listeners and pollute history with canceled tasks)

Hi @Cynizm,

for each task, you can set the assignee directly to the expected value with this Rest API: Set Assignee |

Maybe loop over all tasks externally, call your logic and the assignee to the new value.

Hope this helps, Ingo

The thing is, that Camunda is embedded within Microservice which holds all the data for evaluating the assignee as well as the algorithm for evaluation, therefore we can not extract the logic outside of Microservice (and also I don’t want to do that via rest api request since this situation will randomly depending on business data). The two solutions I’m thinking of are:

  1. Retrigger the user task decorator
  2. use the same mechanism Camunda uses for expression evaluation

but I don’t know which one of these would be proper solution, moreover both of them seem more like a hack than legit solutions (since in first one I would need to operate on TaskEntity and the second one requires fetching the expression from process definition).

Or maybe is there another mechanism I could use?