TaskListener: Distinguish between automatic assignments and explicit assigments

Hello everyone,

every time a user is assigned on task creation because of setting the Assignee property in the model (see screenshot’) two events are emitted to the TaskListener: Create and Assignment.

image

Is it possible to distinguish between assignments which are performed at task creation and assignments which are performed later on?

Thanks!

Kind regards
Oliver

Hi @OLibutzki,

In the case of auto assignment, both create & assignment events are triggered whereas only assignment event is triggered in case of explicit assignment.

  1. Configure a task listener on create event with below implementation
    task.setVariableLocal("auto", true);

  2. Use below implementation for task listener configured on assignment event

if (task.getVariableLocal("auto")) {

	// auto
	
	
	task.setVariableLocal("auto", false);
} else {

	// explicit
}

Thanks for the suggestion!

1 Like