cancel
Showing results for 
Search instead for 
Did you mean: 

how to get task information in ActivitiEventListener by ActivitiEvent

smartxiaofish
Champ in-the-making
Champ in-the-making
Hi,

I create some tasks by TaskService, and create a ActivitiEventListener to listen TASK_CREATED event. and wish to inform candidates with this task summary.
but on
public void onEvent(ActivitiEvent event){}
method, event only exposes <blockcode>type, executionId, processInstanceId and processDefinitionId</blockcode>, no information about the task which dispatched  this event.

is there any method to get task information like task id in ActivitiEventListener?

thank you~
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
You have to cact the ActivitiEvent to the correct subclass, so you have access to the TaskEntity.

piyush_kaizen
Champ in-the-making
Champ in-the-making
There is no event for HistoricTaskInstance created .
How can i get the start time / end time etc details in ActivitiEventListener ?
I don't want to call new Date() to get time during TASK_CREATED event as that information may be slightly out of sync with data stored in act_hi tables .