Activity assign to user from previous activity

I want to assign the activity to user who completed the previous activity in the bpmn process design?

Hi @Tulika_G,

One way could be to store the authenticated user who completed the task in a variable to be assigned to the assignee attribute of the next user task.

Reading the authenticated user who completed a user task can be done using a task listener configured on the complete event

public void notify(DelegateTask delegateTask) {
		
	IdentityService identityService;
	Authentication authentication;
	
	identityService = delegateTask.getProcessEngineServices().getIdentityService();
	authentication = identityService.getCurrentAuthentication();
	
	System.out.print("authentication.getUserId(): " + authentication.getUserId());
	
	delegateTask.getExecution().setVariable("completedBy", authentication.getUserId());
}

Kindly find attached a simplified running example
get_completed_by_process.bpmn (3.5 KB)