slb
March 3, 2020, 1:35pm
1
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
Niall
March 3, 2020, 1:36pm
2
Can you upload your model?
It’s important to see the technical details.
slb
March 3, 2020, 2:02pm
3
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();
}
Niall
March 3, 2020, 2:06pm
4
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.
slb
March 3, 2020, 2:20pm
5
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.
Niall
March 3, 2020, 2:39pm
6
Take a look at this point in the error handling tutorial , it should explain what you need to do.