cancel
Showing results for 
Search instead for 
Did you mean: 

process instance does not end

delamotte
Champ in-the-making
Champ in-the-making
Hi,

I use Activiti 5.19.

Well, perhaps something I missed…
I wrote two simple test processes (see attachment), and a bit of java code to play them.

The first one :
start –> CNV_human1 –> CNV_human11 –> end

The second one :
start –> parallel Gateway –> CNV_human1 –> CNV_human11 –> end
…………………………… –> CNV_human2

In my java test cases, I start the processes, then complete CNV_human1, and CNV_human11.
I can see in the database that the first process ends, but the second one doesn't.

Could you please tell me what's wrong?

Regards,

Philippe.
8 REPLIES 8

hari
Star Contributor
Star Contributor
Hi,

You have not connected your CNV_human2 to any bpmn element. Connect it to an End and try again. It will work.

delamotte
Champ in-the-making
Champ in-the-making
Hi Hari, thanks for your reply, but I don't want to connect CNV_human2 to an end event. That's not the way my process is designed. The doc says that when an end event is reached, the process should end. That's what I expect.
Anyway, I made the test, just for see what happens, and the process doesn't end.

shagufta1
Champ in-the-making
Champ in-the-making
I think you need to again add parallel gateway connect both user task and then end it.

Thanks,
Shagufta Shaikh
Developer,
Tata Consultancy Services
http://www.tcs.com

delamotte
Champ in-the-making
Champ in-the-making
Hi Shagufta,
Thanks for your reply. Perhaps that adding gateways would work, but I really would like to understand why this process does not end. This use case seems to be valid, regarding BPMN2 specs, so it should end when one execution reaches an end point. Doesn't it?

shagufta1
Champ in-the-making
Champ in-the-making
See In activiti if you are starting the task with parallel gateway it means that each task must complete.

Now how process engine will know about it that whether the parallel processes are complete or not so here you can tell process engine that all task is completed parallely via another parallel gateway (end parallel Gateway).

Thanks,
Shagufta Shaikh,
Developer,
Tata Consultancy Services
http://www.tcs.com

delamotte
Champ in-the-making
Champ in-the-making
Shagufta, I'm perhaps missing something very simple… but I've read the Activiti doc once more, and I don't understand that "if you are starting the task with parallel gateway it means that each task must complete". I understand that a parralel Gateway is just a fork.
Furthermore, I tried to add <code><terminateEventDefinition activiti:terminateAll="true"></terminateEventDefinition></code> to my end node, and then, the process ends normally; but it also ends the caller process, which is not what I want, so I can't use it as a workaround.

shagufta1
Champ in-the-making
Champ in-the-making
if you are starting the task with parallel gateway it means that each task which you have started with parallel gateway must complete. Till then process will wait for task to be completed. Then only process will go for further steps otherwise process will stuck their only. This is what I want to say.

And are you using sub-process for this tasks?

delamotte
Champ in-the-making
Champ in-the-making
Shagufta, thank you very much for trying to help me. I think I understood what you want to say, even if my English is not really good…
So, I tried the following tests :

1) I deleted the parallelGateway, and simply replaced it by two sequenceFlow comming from start node, and respectively going to humanTask1 and humanTask2. Then, I don't have parallelGateway anymore in my process.
The result : the process doesn't end (NOK : it should).

2) I tried to add <code><terminateEventDefinition activiti:terminateAll="true"></terminateEventDefinition></code> to the end node.
The result : the process ends, and the caller process also ends (OK).

3) I tried to add <code><terminateEventDefinition activiti:terminateAll="false"></terminateEventDefinition></code> to the end node (terminateAll is false, vs true in the previous test).
The result : the process ends (OK), and the caller process also ends ( NOK : it shouldn't).

All of that really doesn't make sense to me…
If, by chance, an activiti developper could have a look, and tell me where, in the activiti code, I could debug to see what happens and point what I am doing wrong…