I have a multi instance sub process and inside that sub process is a service task that uses an expression to start another process instance.
I’d like to attach a catch mechanism to that service task so it can handle any exceptions from executing the expression. Is this possible? I’d like to avoid creating a custom class and then put try/catch around the method and then throw a BpmnError.
Generally you can either trigger the error event using the JavaAPI either through JavaScript as a listener or a script task or plane java in the Java Delegate being called by the service task.
This tutorial video explains how error handling works in more detail, you might find it useful.
If something goes wrong while executing that I’d like to catch it and then do some processing…raise an incident for support to investigate. Just trying to work out how to handle that exception (chances are it might be an engine exception). My service task config looks like:
I could change the send task to use external task but I was hoping to test some of my assertions without needing to configure external tasks hence the use of expressions.