cancel
Showing results for 
Search instead for 
Did you mean: 

How to terminate called workflow(from serviceTask) when calling workinglow terminated?

swamy2156
Champ on-the-rise
Champ on-the-rise
Hi,

I am facing a tricky problem with my workflows. I developed a generic notification workflow to trigger notification mails if task is not owned by any one of userGroup since task get created, which I can be integrate in any of the workflow(A boundary timer on UserTask which connects to a serviceTask. In serviceTask by calling API runtimeService.startProcessInstanceByKey("notification-process", map) ).

Now thing is that, when calling process instance got terminated according to flow, this notification process instance still persists and trying to invoke notifications though task get closed.
Is there a way to delete notification process instance when calling process instance got terminated(or) task got completed?

(Attached workflow bpmn modal for reference)


Thanks,
Swamy.
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
what version of Activiti are you using. In recent versions, calling the runtimeService should be done in the same transaction.

swamy2156
Champ on-the-rise
Champ on-the-rise
Thanks for your reply Joram. I am using Activiti v5.17. The serviceTask(which calls runtimeService.startProcessInstanceByKey("notification-workflow")) is attached to timer boundary which means a new Transaction will opened while invoking a serviceTask. But when process instance get terminated by completing UserTask, runtimeService will be in different transaction(If I understand correctly). Please through some light on this.