个人技术分享

在这里插入图片描述

  • 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);
    }