AnsweredAssumed Answered

Cannot get ServiceTasks and EndEvents description in listeners

Question asked by pmesmeur on Jul 10, 2015
Latest reply on Jul 13, 2015 by pmesmeur
A model can contain ServiceTasks and EndEvents. If listeners are recorded in the engine, I can be notified of them via the function:
[java]
void ExecutionListener.notify(DelegateExecution execution);
[/java]

Moreover, the modeler allows to fill a "Description" for both ServiceTask and EndEvent.

What I would like is to be able to retrieve the "Description" field in my listeners.

I tried things like this, but in vain:
[java]
void ExecutionListener.notify(DelegateExecution execution) {
            String id = execution.getCurrentActivityId();
            Task t = execution.getEngineServices().getTaskService().createTaskQuery().taskId(id).singleResult();
            status = t.getDescription();
/// OR
            String id = delegateExecution.getId()
            Task t = delegateExecution.getEngineServices().getTaskService().createTaskQuery().taskId(id).singleResult();
            status = t.getDescription();
}
[/java]

Each time, I get a null Task. I have the impression to "beat about the bush". Can you please help me?

Thanks

Outcomes