RemoteIdmService is null when using a TaskListener

I have created a TaskListener and I am using the flowable-ui-task-app. When the listener executes the RemoteIdmService is null.

public class AssignEmailListener implements TaskListener {

private RemoteIdmService remoteIdmService;

private static final long serialVersionUID = 1L;

public void notify(DelegateTask arg0) {
	DelegateTask task = arg0;
	String assignee = task.getAssignee();
	if (assignee == null) {
		System.out.print("assigned to group");
	} else {
		System.out.println("assignee = " + assignee);
		User user = remoteIdmService.getUser(assignee);


I have tried to Autowire other services and they are also null. What needs to be done to use the services in the TaskListener?

  • which package does your taskListener have? i.e. is it scanned by component scanning?
  • how did you configure the listener in the process? i.e. is it a spring bean delegation?

The package is

I have tried with both class and Delegate Expression

<userTask id="sid-A78294D0-B3A6-4976-AFC3-0FC871712BF3" flowable:assignee="admin">
    <flowable:taskListener event="assignment" delegateExpression=""></flowable:taskListener>
    <modeler:activiti-idm-assignee xmlns:modeler=""><![CDATA[true]]></modeler:activiti-idm-assignee>
    <modeler:assignee-info-email xmlns:modeler=""><![CDATA[]]></modeler:assignee-info-email>
    <modeler:assignee-info-firstname xmlns:modeler=""><![CDATA[Test]]></modeler:assignee-info-firstname>
    <modeler:assignee-info-lastname xmlns:modeler=""><![CDATA[Administrator]]></modeler:assignee-info-lastname>
    <modeler:initiator-can-complete xmlns:modeler=""><![CDATA[false]]></modeler:initiator-can-complete>

I changed the code to use the applicationContext and it now it works.