Unable to produce INTERNALLY_TERMINATED status


#1

Hello,

I’m using Camunda Process Engine version 7.9.

I’m unable to reproduce the conditions to generate the INTERNALLY_TERMINATED process_instance status. I thought the process depicted on [https://docs.camunda.org/manual/7.9/reference/bpmn20/events/terminate-event/] would do just that but It actually ends with a process_instance status of “COMPLETED”.

Can someone give me an example of a process that could actually end with the INTERNALLY_TERMINATED status.

Ultimately, I’m trying find a way to distinguish processes that:

  1. Are cancelled --> EXTERNALLY_TERMINATED
  2. Reach their normal ending --> COMPLETED
  3. End prematurely due to process instance conditions --> ??? (INTERNALLY_TERMINATED)

Thanks.


#2

Hi Patrick,

I checked the javadoc:

  /**
   * Return current state of HistoricProcessInstance, following values are recognized during process engine operations:
   *
   *  STATE_ACTIVE - running process instance
   *  STATE_SUSPENDED - suspended process instances
   *  STATE_COMPLETED - completed through normal end event
   *  STATE_EXTERNALLY_TERMINATED - terminated externally, for instance through REST API
   *  STATE_INTERNALLY_TERMINATED - terminated internally, for instance by terminating boundary event
   */
  String getState();

So INTERNALLY_TERMINATED are instances terminated by terminating boundary event.
Terminate end event cause completion of the process instance.

Best regards,
Yana


#3

Thanks Yana for the quick reply but I still can’t reproduce that status.

Does Camunda Modeler support terminating boundry events? I don’t see it.
image

If it does support it, can you point me to a relevant process definition example.

Thanks.


#4

The Error end event is producing INTERNALLY_TERMINATED process instances.
image
There is no such thing as terminating boundary events, maybe the javadoc needs to be adjusted.
Sorry for the misleading info.


#5

Hi Yana,
I tried the process example you gave above (with the Error End Event) and it returns a status of “COMPLETED”. Have you tried it?
Thanks.


#6

Yep, I will send you an example on Monday.


#7

Please check the following test:


#8

Thanks Yana. This sure helped me better understand the subtlety of the process status.

For the others that may read this post in the future, here is the link to the BPMN file used in the test mentionned above by Yana.


#9

I am unable to receive INTERNALLY_TERMINATED through error end event. find attached files and suggest me…it is still showing completed.
c3.txt (4.3 KB)


#10


#11

Please reply to this, and let me know if any other part of the code is needed.Please send me changes apart from the bpmn to be made to produce INTERNALLY TERMINATED status


#12

Why do you need INTERNALLY_TERMINATED status, what is your goal?
The conditionals when the INTERNALLY_TERMINATED is recorded are quite specific.
If you check the example posted by pmessier:
You need parent process with call activity and child process with Error End event.
When you trigger the parent process, the child process will be mark as INTERNALLY_TERMINATED and the parent as COMPLETED.


#13

There is a java delegate code written in my service task, and when there is an error I want the process to terminate and it should show TERMINATED status. So, if it keeps showing COMPLETED , I am not able to ascertain error while giving the history rest call. I am throwing a new bpmnError in from my code which is caught by error boundary event and thereafter it should terminate with error.


#14

Please reply as soon as possible.


#15

Please understand that this forum is a free offering that is community-driven and that Camunda operates on a best effort basis. If you need timely assistance, please consider contacting a Camunda partner for consulting: https://camunda.com/partners/

Cheers,
Thorben


#16

Hey, I need help in error termination of the process. It is difficult to understand as to when and how it will reflect any state other than COMPLETED.


#17

I am not able to find an understand the code of pmessier which helps in producing different states


#18

My goal is to ascertain the actual status of the process, if it is completed then it should show completed and if there is an error it should terminate abruptly. Otherwise by the history call, error is not visible with the completed status.