the error event exists to catch an error that happens inside the subprocess. If you want to cancel the subprocess, you should use a message boundary event.
To use the error correctly, one of the activities inside your process should throw it.
yes. Inside a JavaDelegate, it is possible to throw a BpmnError containing code, message and cause.
This will then be mapped to a error event inside your process.
if I got you right you are waiting for a message that contains information about an error that happened? This is exactly the use case of a message catch event.
The error event would mean that during a service call (either snychron or external) or a human task, an error comes up that needs to be handled in a certain way.
I can also provide some example models later if you want.
Maybe it’s better if I tell you what I’m trying to do.
I have a workflow with a subprocess inside it.
I would like to be able to cancel the subprocess at any time by an external message.
When I cancel the subprocess the parent process must go into a “Terminate End Event” (“Annulla” into my screenshot).
According to that, I used an error event because it stops the process, contrary to messages.
But when I reach the “Message End Event” (red circle) the activity is interrupted and the sequence flow doesn’t continue through the “Message boundary event” (red circle) but it is going out the normal flow (green circle).
Unfortunately, messages in BPMN have a rule by which a process cannot send a message to itself.
If you replace them with an error event or an escalation event it’ll work.
@tavolate , we had a misunderstanding then. Instead of using the message end event inside the subprocess, I would have expected you to send a message directly to the boundary event from outside. I am sorry for this.