AnsweredAssumed Answered

BpmnError catching

Question asked by mikuc on Jan 23, 2015
Latest reply on Jan 23, 2015 by martin.grofcik
Hello everyone,

Please I need some advice from you. I have som processes, that are using the same service task to find supervisor(manager) for logged user in LDAP using delegate expression, because every process is an osgi bundle.
How can i catch an BpmnError an send this error to another task e.g. to it admins.

[IMG]http://i62.tinypic.com/2qx858m.jpg[/IMG]

Is it possible to catch error on a service task an send it to userTask, or i need to use another path in case some exception occurs?

Here is my service task

<code>

import java.util.List;

imports…

public class  Supervisor implements JavaDelegate {
   
  public void  execute(DelegateExecution execution) throws Exception {
     try {
    FindSuperiorLogic();

     } catch (Exception  e) {
        execution.setVariable("bpmError", e.toString());
        throw new BpmnError("BusinessExceptionOccurred");
       }
  }

<code>

Error boundary event should catch the "BusinessExceptionOccurred" and go to usertask to fix the error.

Thanks a lot for help and advice

Outcomes