TaskListener J2EE Wildfly

We want to inform a User Task, when a task is created. Running under Wildfly as a J2EE application.

my TaskListener:

@Named(value = “EkTaskListener”)
public class EkTaskListener implements TaskListener {

@Override
public void notify(DelegateTask delegateTask) {
    System.out.println("##### EK Task Listener called notify ##### " + delegateTask.toString());
}

public void test() {
    System.out.println("##### EK Task Litener called test #####");
}

}

my BPMN Code:
<camunda:taskListener delegateExpression=“${EkTaskListener.test()}” event=“create” />

An error happened while submitting the task form : Cannot submit task form 6d3f248c-4f0b-11e9-a8aa-6e4d73b29a62: ENGINE-03051 There was an exception while invoking the TaskListener. Message: ‘Delegate expression ${EkTaskListener.test()} did not resolve to an implementation of interface org.camunda.bpm.engine.delegate.TaskListener’

We have also tried to call our TaskListener as a Java Class

Any ideas ?

Dieter

Hi Dieter,

you don’t need the test() method. By using delegateExpression the engine knows that it must call the notify() method. So just delegateExpression="${EkTaskListener}" is enough.

Cheers,
Falko

Thanks, I have forgoten at the first test the @Named… Now it works

Dieter