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