Wherefrom to throw BpmnError?

Hello,

I want to throw a BpmnError to get out of a subprocess. Tthe subprocess has an interrupting .error boundary event attached. This is about camunda 7.1.

Problem is: throwing the BpmnError does not seem to cancel the execution, nor does it invoke the error-boundary-event-sequence-flow.

Therefore my question is: wherefrom exactly is it agreeable to throw an error?

I tried throwing from delegate expression, invoked from task begin/end, execution begin/end, sequence-flow begin/end and from gateway execution listeners.

This might be an issue with my integration of the Engine into our product, so any general advice on how it is supposed to work is very much welcome.

Thanks in advance,
matt

Hi Matt,

I think you can only throw errors from activity implementations, e.g. the delegate expression of the activity itself, not from listeners. At least that is what we test for.

Cheers,
Thorben

Hi thorben,

is there any way to raise an error from a user task?
I’d be content with adding something to every sequence flow inside my subprocess too.

cheers, matt