We have multiple subprocess and inside subprocess we have rest connector and message intermediate throw event.We are unable to capture the incident/error details for Java zeebe client.
any reference how to capture the error details.
We have multiple subprocess and inside subprocess we have rest connector and message intermediate throw event.We are unable to capture the incident/error details for Java zeebe client.
any reference how to capture the error details.
Hi @sonalidas are you using jobworkers or the REST Connector available via the Out-Of-The-Box Connectors?
Does this help: Using Connectors | Camunda 8 Docs
We are using Jobworker(Zeebe) for java client and rest output connector for the workflow.
Attached the workflow for reference:
Code we have used for:
@PostMapping(“/start”)
public Mono startProcessInstance() {
LOG.info(“Starting process " + BPMN_PROCESS_ID + "
”);
String requestId = UUID.randomUUID().toString();
Map<String, String> variables = Collections.singletonMap(“requestId”, requestId);
// TODO: Add exceptionally
zeebe
.newCreateInstanceCommand()
.bpmnProcessId(BPMN_PROCESS_ID)
.latestVersion()
.variables(variables)
.send();
// TODO: Think about exception handling here as well
// TODO: Where to define timeout exactly?
return Mono.create(
sink -> {
// define a unique job type just for this conversation
String jobType = "responseFor_" + requestId;
// And start a worker for it
ZeebeWorkerValue jobWorkerConfig = new ZeebeWorkerValue();
jobWorkerConfig.setType(jobType);
jobWorkerConfig.setAutoComplete(true);
jobWorkerConfig.setName(jobType);
JobWorker jobWorker =
jobWorkerManager.openWorker(
zeebe,
jobWorkerConfig,
(client, job) -> {
// Read payload from process
String response = (String) job.getVariablesAsMap().get("response");
LOG.info(".. finished with response: `" + response + "`");
// When the job is there, read the response payload and return our response via
// the Mono
sink.success(response);
});
// Make sure this worker is closed once the response was received
sink.onDispose(() -> jobWorkerManager.closeWorker(jobWorker));
});
}
}
Hi @sonalidas are you looking for a way to report an error or create an incident with zeebe? Then you would need to look into the Java Client and try something like this:
client
.newThrowErrorCommand(job)
.errorCode(error.code())
.variables(error.variables())
.errorMessage(truncateErrorMessage(error.message()));
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.