Camunda 流程执行错误处理ERROR BOUNDARY EVENT

 ERROR BOUNDARY EVENT:在任务发生异常时候会触发走,在代码中必须显式抛出

throw new BpmnError("error.....");
public void execute(DelegateExecution delegateExecution) throws Exception {
        System.out.println("进来了>>>>>>>>>>>>>");
        delegateExecution.setVariable("num",1);
        try {
            System.out.println(1/0);
        } catch (Exception e) {
            //ERROR BOUNDARY EVENT 显式声明,否则不起作用
            throw new BpmnError("error.....");
        }
        Thread.sleep(10000);
    }

 

posted @ 2024-05-05 18:48  洞玄巅峰  阅读(69)  评论(0编辑  收藏  举报