cancel
Showing results for 
Search instead for 
Did you mean: 

Process instances got stuck at the parallel gateway

rishiraj_kalla
Champ in-the-making
Champ in-the-making
Hi,

I am working on an application where BPM engine is developed using Activiti 5.13. There is one main process xml which conditionally invokes 4 different caller activities(sub processes) in parallel and all the 4 sub processes are routed to join using a parallel gateway. We noticed that there were many instances which have all the tasks completed (No active task in ACT_RU_TASK table for the given process instance id) however the ACT_RU_EXECUTION table indicate that the instance is stuck at the parallel gateway (No End time for parallel gateway step in ACT_HI_ACTINST while all other steps have and ) and has not ended, we have changed the parallel gateway to inclusive gateway but now just wondering is there any way through APIs to move forward those stuck instances at parallel gateway. Due to this issue some of the reporting stats like completed instances are shown incorrectly. Since I have joined team recently I do not have any log or exception trace for it.

I tried to reproduce this by creating a similar template but without any forms and fields in it but was unable to reproduce the scenario.

If anybody is aware please let me know if there is any such API or steps to be taken to move ahead such stuck instances. Once these parallel gateway completes the process will end as there is no further step after it.

With Thanks and Regards,
Rishi

11 REPLIES 11

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Rishi,

jUnit test would help me a lot to reproduce this issue.
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

Hi Martin,

Thanks for your reply, I have created jUnit test and a sample process but wasn't able to reproduce this, I was just wondering if there is any way to mark such instances as complete as we have instances in production environment which needs to be marked as complete and they are stuck at the parallel gateway and does not have any end time for it. In the meantime I will continue to work on more scenarios to see if I can reproduce this.

Appreciate your help.

Thanks,
Rishi

Hi,

After further searching on forum I found the below link which very much resembles the situation where I am in.

http://forums.activiti.org/content/process-end-time-not-available-process-end-listener

I have further explored and figured out that all the task of the main process as well as subprocesses triggered by the main process instance id are completed but the main or parent process instance does not have and end time, and action history for the same instance indicate that there is no end time for the parallel gateway which is the last step before completion of the instance.

Since we are using SpringProcessEngineConfiguration embedded in web server, I am not sure if there is any way to mark such instance completed again.

Could it be possible that the end time for the process instance is NULL because either ProcessInstanceEndHandler hasn't yet been invoked as the parallel gateway is not ended yet or it was invoked but the DB changes wasn't flushed.

Just wondering if the first condition above is true then how can I mark the parallel gateway as completed so that ProcessInstanceEndHandler  gets invoked and do the rest of the job.

Eagerly looking for the help.

Regards,
Rishi

jbarrez
Star Contributor
Star Contributor
Could you paste the content of the ACT_RU_EXECUTION for this process instance? That will learn us where everything is.

Thanks for your reply, I have attached the formatted text file having the content of ACT_RU_EXECUTION. I have also attached the content of ACT_HI_ACTINST if that helps further.

Regards,
Rishi

Hi,

After further testing I have noticed that if there is any exception thrown by the global process execution listener (at process end event) this inconsistent state arrives, I might be wrong but it looked like the context get removed and the transactions done through it are rolled back causing execution in unstable mode,perhaps in such a condition like I am facing where it seems that instance is stuck up at gateway and since gateway activity cannot be signaled I could not figure out any way to resume this instance so that it gets back on track.

Please suggest if there is any way here.

With Thanks and Regards,
Rishi

jbarrez
Star Contributor
Star Contributor
It's really hard to follow with one long sentence…. could you try to make things a bit clearer?

Hi Joram,

Apologies for the long sentence, here is summary:
1. Process has an execution listener on the end event
2. The execution listener threw an exception which made the instance to roll back to parallel gateway
3. As per the ACT_HI_ACTINST and ACT_RU_EXECUTION the instance is waiting at parallel gateway

I am looking for any API in Activiti version 5.13 to make this instance move ahead.

With Thanks and Regards,
Rishi

frederikherema1
Star Contributor
Star Contributor
Is it possible to share the process bpmn? Could be something in the process design that is causing this. The transactional system in activiti is designed to work from one wait-state to another in a single transaction. If it rolls back to the parallel gateway, this means there is an async activity after the parallel gateway, forcing activiti to save execution state right here.