cancel
Showing results for 
Search instead for 
Did you mean: 

Get task name in notify method of ExecutionListner

simonetogno
Champ in-the-making
Champ in-the-making
Hi, it is possible get the name and the id of the task that have call the ExecutionListner?(don't ask me why, is too complex form me to explain)

Regards

Simone
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Can't you use a TaskListener instead of an ExecutionListener? This way, you get a DelegateTask passed, which allows you to get name and ID.

http://activiti.org/userguide/index.html#taskListeners

simonetogno
Champ in-the-making
Champ in-the-making
The task listner must be used with user task if I'm not mistaken.
This is too tight constraint for my usage.
While debugging I have see that the information abaut name and id's task is in the DelegateExecution object, but ther ther aren't the relative get method.
This is a little bit frustrating.

Actually i pass the name as variable setted with listner in the diagram, and i get it with injection, but my goal is to minimize the overhead operation that the analist must add at the diagram for the execution

regards

frederikherema1
Star Contributor
Star Contributor
I see, you're referring to the activity ID.

Indeed, there is no getter exposed for getting the current active activity-id(s). If you think there are good use-cases you can file an issue suggesting to add the method to the DelegateExecution API. In the mean time, you're stuck with casting the DelegateExecution to ExecutionImpl (or Entity, not sure) and using that.