Camunda:如何使用 Java API 读取事件堆栈跟踪
Camunda: How to read incident stack trace with Java API
假设我使用 RuntimeService.createIncidentQuery()...
.
发现事件 (org.camunda.bpm.engine.runtime.Incident
)
有没有办法使用 Java API 读取实际事件堆栈跟踪?在 Cockpit 中可访问相同的堆栈跟踪。
如果作业失败,则事件的配置/负载将是作业 ID。如果事件是由失败的外部任务引起的,那么它将是外部任务 ID。
因此:
Incident incident = runtimeService.createIncidentQuery().singleResult();
String configuration = incident.getConfiguration();
log.info("Incident type: {}", incident.getIncidentType());
if (incident.getIncidentType().equals(Incident.FAILED_JOB_HANDLER_TYPE)) {
log.info("Here comes the stacktrace: {}", managementService.getJobExceptionStacktrace(configuration));
} else {
log.info("Here come the error details: {}", externalTaskService.getExternalTaskErrorDetails(configuration));
}
假设我使用 RuntimeService.createIncidentQuery()...
.
org.camunda.bpm.engine.runtime.Incident
)
有没有办法使用 Java API 读取实际事件堆栈跟踪?在 Cockpit 中可访问相同的堆栈跟踪。
如果作业失败,则事件的配置/负载将是作业 ID。如果事件是由失败的外部任务引起的,那么它将是外部任务 ID。
因此:
Incident incident = runtimeService.createIncidentQuery().singleResult();
String configuration = incident.getConfiguration();
log.info("Incident type: {}", incident.getIncidentType());
if (incident.getIncidentType().equals(Incident.FAILED_JOB_HANDLER_TYPE)) {
log.info("Here comes the stacktrace: {}", managementService.getJobExceptionStacktrace(configuration));
} else {
log.info("Here come the error details: {}", externalTaskService.getExternalTaskErrorDetails(configuration));
}