public void raiseIncident(ErrorType errorType, String errorMessage) { incidentCommand.reset(); incidentCommand .initFromWorkflowInstanceFailure(record.getKey(), record.getValue()) .setErrorType(errorType) .setErrorMessage(errorMessage); eventOutput.storeFailedRecord(record); commandWriter.appendNewCommand(IncidentIntent.CREATE, incidentCommand); }
public void raiseIncident(ErrorType errorType, long variableScopeKey, String errorMessage) { incidentCommand.reset(); incidentCommand .initFromWorkflowInstanceFailure(record.getKey(), record.getValue()) .setErrorType(errorType) .setErrorMessage(errorMessage) .setVariableScopeKey(variableScopeKey); eventOutput.storeFailedRecord(record); commandWriter.appendNewCommand(IncidentIntent.CREATE, incidentCommand); }
@Override public void processRecord( TypedRecord<JobRecord> event, TypedResponseWriter responseWriter, TypedStreamWriter streamWriter) { final JobRecord value = event.getValue(); if (value.getRetries() <= 0) { final JobHeaders jobHeaders = value.getHeaders(); final DirectBuffer jobErrorMessage = value.getErrorMessage(); DirectBuffer incidentErrorMessage = DEFAULT_ERROR_MESSAGE; if (jobErrorMessage.capacity() > 0) { incidentErrorMessage = jobErrorMessage; } incidentEvent.reset(); incidentEvent .setErrorType(ErrorType.JOB_NO_RETRIES) .setErrorMessage(incidentErrorMessage) .setBpmnProcessId(jobHeaders.getBpmnProcessId()) .setWorkflowInstanceKey(jobHeaders.getWorkflowInstanceKey()) .setElementId(jobHeaders.getElementId()) .setElementInstanceKey(jobHeaders.getElementInstanceKey()) .setJobKey(event.getKey()); streamWriter.appendNewCommand(IncidentIntent.CREATE, incidentEvent); } } }
incidentEvent.reset(); incidentEvent .setErrorType(ErrorType.JOB_NO_RETRIES)