cancel
Showing results for 
Search instead for 
Did you mean: 

Java Service Tasks - Java exceptions

ruedesilva
Champ in-the-making
Champ in-the-making
Hi,

In a Java service task I am calling EJBs in a different system. When exceptions are thrown from the EJB how do I throw an exception in the service task (JavaDelegate) so that the exception can be translated to a BoundaryErrorEvent so that a proper path can be followed in the WF ? Or do I need to catch exceptions within the service task set some Process variables and use exclusive gateway to take different paths for different exceptions?

thanks,
Rue
1 REPLY 1

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
you can't throw an error event IN a service task and catch it on the same service task. You can do that with call activities (see http://www.activiti.org/userguide/index.html#bpmnBoundaryEvent)

Java execptions should be handled IN the service task and result in a logical bpmn outcome as indeed e.g. setting a variable and use that later on. So yes, you can (should) do it the way you describe.