cancel
Showing results for 
Search instead for 
Did you mean: 

About task id...

jcosano
Champ in-the-making
Champ in-the-making
I have this structure (target send an email with taskId waitting for do)

- parallelGateway fork
branch1: userTask (sequenceFlow join)
branch2:  serviceTask + serviceTask Mail (sequenceFlow join)
- parallelGateway join

serviceTask: obtain task id of userTask branch1:
String idTask = engine.getTaskService().createTaskQuery().processInstanceId(key).singleResult().getId();
And move this value to variable used in serviceTask Mail

Ok, seems that "join" regenerate userTask assign a new Id.. then  workaround fail because taskid sended in mail doen't exists.
I don't need do "join" but if i don't put join node, I have an sql error.

Question is: Why task change its id?
3 REPLIES 3

jcosano
Champ in-the-making
Champ in-the-making
If I don't use join:

Cannot add or update a child row: a foreign key constraint fails (`activiti`.`act_ru_task`, CONSTRAINT `FK_TASK_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `act_ru_execution` (`ID_`))

tombaeyens
Champ in-the-making
Champ in-the-making
just so that you know:

we're adding event listeners this release (rc1).  then you'll be able to send notification email without fork and join.  just be associating a listener to the userTask activity.

in the future we also target to have a notification attribute on the userTask to get this behavior

jcosano
Champ in-the-making
Champ in-the-making
This post is because for me was strange that same task, along the time, its taskid change…

For the moment, I wait for new event listener…

thanks!