Exception Not caught at boundary event thrown by method called from input variable

Hi All,

I’m trying to catch exception using error boundary event. In my flow I have one service task on which I have one input variable which calls a java method which throw a exception and I want to catch that using boundary event but it’s not working. please help me here if know.

Below is the method I’m calling from Input variable

package com.example.workflow;

import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;

@Component("inputVariable")
public class InputVariable {

    public String throughException(DelegateExecution execution) throws BpmnError{
        // Simulate an error
        System.out.println("exception Delegation called");
        throw new BpmnError("Error_Code", "caught");

    }
}

P.S- Find attached my BPMN

callActivityerror.bpmn (4.7 KB)

Hi @dandotiya9722.
The BPMN error is not supposed to be thrown in a input variable mapping. This causing an exception in the evaluation of the expression and will never trigger your boundary event.
The BPMN error is supposed to be thrown by your service task implementation. Anyway a BPMN error should only be used for “business” exceptions, which should normally not be happening in some input variable mapping.

thank you @rohwerj

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.