Camunda 流程執行錯誤處理ERROR BOUNDARY EVENT

洞玄巅峰發表於2024-05-05

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

相關文章