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).
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?