Unusual interaction in the Camunda process engine - possible bug?

Hello,

While building a check to evaluate whether process instances are active or not, I have discovered an unusual interaction in the Camunda process engine, and I believe this could be a bug.

Suppose we have a process definition consisting of a “main” process containing an event-based gateway and an event subprocess with an interruptive message catch start event (see image).
image
Now, if we have an instance of this process and the event subprocess triggers, the “main” process is interrupted, and the user task in the subprocess becomes active.

In this scenario, the database shows that the main process instance gains the status “INTERNALLY_TERMINATED”, and the property END_TIME_ is filled with the current date/time (no longer NULL).

Subsequently, if the event subprocess is completed, the (main) process instance gains the status “COMPLETED”, and the END_TIME_ is overwritten with the date/time of completing the event subprocess.

I find it strange that both the status and END_TIME_ for a process instance may be changed in this situation. This suggests that either (A) “INTERNALLY_TERMINATED” is not an actual end state, or (B) the process should not gain the status “INTERNALLY_TERMINATED” and no END_TIME_ should be set.

Is this intended behaviour?

Hi @Jelle_B,
I think it is intended to work this way…

You chose to use the interrupting event subprocess where your main process would be ended when your event subprocess gets triggered.

Hello @hassang

Thank you for your response. Unfortunately, you did not address my actual question.

The issue is not that the main process is ended by the interruptive subprocess.
The issue is that the main process is ended by the interruptive subprocess, and then its properties change when the subprocess is completed.

One would expect that once a process instance reaches any end state, its properties will no longer change.

However, in the above case, the main process gains the status “INTERNALLY_TERMINATED” and the END_DATE_ value is set when the subprocess is triggered, while after the subprocess is completed, the status of the mian process changes to “COMPLETED” and the END_DATE_ timestamp is overwritten.

So my question remains: Is this working as intended?