Set assignee in User Task without delegate code

I have a User Task on which I want to set the assignee based on the value of a string variable.
e.g., if target == “A” → assignee = UserA
if target == “B” → assignee = UserB

I can either do it para metrically on the “Assignee” field of the modeler, or set a Create Task Listener on which I can write a script. But how the script should look like?

Thx

I would say that putting an expression in the assignee field is your best bet, it’s quite easy and doesn’t require any additional code.

If you wanted you could also create a TaskListener which can be triggered on create then you would have access to the task object in your code and could assign a user if you like.

1 Like