ENGINE-13033 Propagation of bpmn error 5000 failed

Hello,

I want to pass the execption stacktrace to the errorHandlerTask

I used
externalTaskService.handleBpmnError(externalTask, “5000”, exception.getMessage(), errorVariableMap);

Since errorVariableMap holds Object i put the execptionStacktrace inside

When Execption comes this does not work

I have the error in the title.

Could you help me ?

Samir

EXP

Can you upload your model?
It’s important to see the technical details.

Hello,

I import my model,

my_exp_handler.bpmn (3.9 KB)

my external worker :

    ExternalTaskClient client = ExternalTaskClient.create()
            .baseUrl("http://localhost:8080/rest")
            .build();
    client.subscribe("myExternalWorker")
            .lockDuration(1000)
            .handler((externalTask, externalTaskService) -> {
                try {
                    LOGGER.info("Start .......");

                    String s = null ;
                    s.toString();

                    Map<String, Object> variablesMap  = Maps.newConcurrentMap();

                    variablesMap.put("variable",true);

                    externalTaskService.complete(externalTask, variablesMap);

                    LOGGER.info("End ....");

                } catch (Exception exception) {
                    // @TODO : Gérer les erreurs
                    HashMap<String, Object> errorVariableMap = Maps.newHashMap();
                    errorVariableMap.put("errorCode", "-58");
                    errorVariableMap.put("errorMessage", "Une erreur se produite");
                    errorVariableMap.put("stacktrace", exception.getStackTrace());
                    //externalTaskService.handleFailure(externalTask, "my errorMessage", "my error details", 0, 0);
                    externalTaskService.handleBpmnError(externalTask, "5000", "my error message", errorVariableMap);
                }
            }).open();
}

The error message in your process has no error code defined.
That might be the problem, if it is then by adding an error that catches code 5000 it should work.

Is there a list of excption code that i should throw ?

which code should i change ?

The code works if i do not put stacktrace in the map.

Take a look at this point in the error handling tutorial, it should explain what you need to do.

OK I see

Thanks