ENGINE-13033 Propagation of bpmn error 5000 failed


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 ?



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


I import my model,

my_exp_handler.bpmn (3.9 KB)

my external worker :

    ExternalTaskClient client = ExternalTaskClient.create()
            .handler((externalTask, externalTaskService) -> {
                try {
                    LOGGER.info("Start .......");

                    String s = null ;

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


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

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