public boolean rejectIncidentCreation( IncidentRecord incidentEvent, CommandControl<IncidentRecord> commandControl) { final IncidentState incidentState = zeebeState.getIncidentState(); final boolean isJobIncident = incidentState.isJobIncident(incidentEvent); if (isJobIncident) { return rejectJobIncident(incidentEvent.getJobKey(), commandControl); } else { return rejectWorkflowInstanceIncident(incidentEvent.getElementInstanceKey(), commandControl); } }
public void assertIncident( final IncidentRecord expectedRecord, final IncidentRecord storedRecord) { assertThat(expectedRecord.getJobKey()).isEqualTo(storedRecord.getJobKey()); assertThat(expectedRecord.getElementInstanceKey()) .isEqualTo(storedRecord.getElementInstanceKey()); assertThat(expectedRecord.getBpmnProcessId()).isEqualTo(storedRecord.getBpmnProcessId()); assertThat(expectedRecord.getElementId()).isEqualTo(storedRecord.getElementId()); assertThat(expectedRecord.getErrorMessage()).isEqualTo(storedRecord.getErrorMessage()); assertThat(expectedRecord.getErrorType()).isEqualTo(storedRecord.getErrorType()); } }
public boolean rejectIncidentCreation( IncidentRecord incidentEvent, CommandControl<IncidentRecord> commandControl) { final IncidentState incidentState = zeebeState.getIncidentState(); final boolean isJobIncident = incidentState.isJobIncident(incidentEvent); if (isJobIncident) { return rejectJobIncident(incidentEvent.getJobKey(), commandControl); } else { return rejectWorkflowInstanceIncident(incidentEvent.getElementInstanceKey(), commandControl); } }
public void assertIncident( final IncidentRecord expectedRecord, final IncidentRecord storedRecord) { assertThat(expectedRecord.getJobKey()).isEqualTo(storedRecord.getJobKey()); assertThat(expectedRecord.getElementInstanceKey()) .isEqualTo(storedRecord.getElementInstanceKey()); assertThat(expectedRecord.getBpmnProcessId()).isEqualTo(storedRecord.getBpmnProcessId()); assertThat(expectedRecord.getElementId()).isEqualTo(storedRecord.getElementId()); assertThat(expectedRecord.getErrorMessage()).isEqualTo(storedRecord.getErrorMessage()); assertThat(expectedRecord.getErrorType()).isEqualTo(storedRecord.getErrorType()); } }
private void attemptToContinueWorkflowProcessing( TypedResponseWriter responseWriter, TypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect, IncidentRecord incidentRecord) { final long elementInstanceKey = incidentRecord.getElementInstanceKey(); final IndexedRecord failedRecord = zeebeState.getWorkflowState().getElementInstanceState().getFailedRecord(elementInstanceKey); if (failedRecord != null) { typedRecord.wrap(failedRecord); queue.clear(); queue.add(responseWriter::flush); stepProcessor.processRecord(typedRecord, responseWriter, streamWriter, queue::add); sideEffect.accept(queue); } }
private void attemptToContinueWorkflowProcessing( TypedResponseWriter responseWriter, TypedStreamWriter streamWriter, Consumer<SideEffectProducer> sideEffect, IncidentRecord incidentRecord) { final long elementInstanceKey = incidentRecord.getElementInstanceKey(); final IndexedRecord failedRecord = zeebeState.getWorkflowState().getElementInstanceState().getFailedRecord(elementInstanceKey); if (failedRecord != null) { typedRecord.wrap(failedRecord); queue.clear(); queue.add(responseWriter::flush); stepProcessor.processRecord(typedRecord, responseWriter, streamWriter, queue::add); sideEffect.accept(queue); } }
public void deleteIncident(long key) { final IncidentRecord incidentRecord = getIncidentRecord(key); if (incidentRecord != null) { zeebeDb.batch( () -> { incidentColumnFamily.delete(incidentKey); if (isJobIncident(incidentRecord)) { jobKey.wrapLong(incidentRecord.getJobKey()); jobIncidentColumnFamily.delete(jobKey); } else { elementInstanceKey.wrapLong(incidentRecord.getElementInstanceKey()); workflowInstanceIncidentColumnFamily.delete(elementInstanceKey); } }); } }
public void deleteIncident(long key) { final IncidentRecord incidentRecord = getIncidentRecord(key); if (incidentRecord != null) { zeebeDb.batch( () -> { incidentColumnFamily.delete(incidentKey); if (isJobIncident(incidentRecord)) { jobKey.wrapLong(incidentRecord.getJobKey()); jobIncidentColumnFamily.delete(jobKey); } else { elementInstanceKey.wrapLong(incidentRecord.getElementInstanceKey()); workflowInstanceIncidentColumnFamily.delete(elementInstanceKey); } }); } }
public void createIncident(long incidentKey, IncidentRecord incident) { zeebeDb.batch( () -> { this.incidentKey.wrapLong(incidentKey); this.incidentRecordToWrite.wrapObject(incident); incidentColumnFamily.put(this.incidentKey, this.incidentRecordToWrite); if (isJobIncident(incident)) { jobKey.wrapLong(incident.getJobKey()); jobIncidentColumnFamily.put(jobKey, this.incidentKey); } else { elementInstanceKey.wrapLong(incident.getElementInstanceKey()); workflowInstanceIncidentColumnFamily.put(elementInstanceKey, this.incidentKey); } }); }
public void createIncident(long incidentKey, IncidentRecord incident) { zeebeDb.batch( () -> { this.incidentKey.wrapLong(incidentKey); this.incidentRecordToWrite.wrapObject(incident); incidentColumnFamily.put(this.incidentKey, this.incidentRecordToWrite); if (isJobIncident(incident)) { jobKey.wrapLong(incident.getJobKey()); jobIncidentColumnFamily.put(jobKey, this.incidentKey); } else { elementInstanceKey.wrapLong(incident.getElementInstanceKey()); workflowInstanceIncidentColumnFamily.put(elementInstanceKey, this.incidentKey); } }); }
private IncidentRecordValue ofIncidentRecord(final LoggedEvent event) { final IncidentRecord record = new IncidentRecord(); event.readValue(record); return new IncidentRecordValueImpl( objectMapper, record.getErrorType().name(), asString(record.getErrorMessage()), asString(record.getBpmnProcessId()), asString(record.getElementId()), record.getWorkflowInstanceKey(), record.getElementInstanceKey(), record.getJobKey()); }
private IncidentRecordValue ofIncidentRecord(final LoggedEvent event) { final IncidentRecord record = new IncidentRecord(); event.readValue(record); return new IncidentRecordValueImpl( objectMapper, record.getErrorType().name(), asString(record.getErrorMessage()), asString(record.getBpmnProcessId()), asString(record.getElementId()), record.getWorkflowInstanceKey(), record.getElementInstanceKey(), record.getJobKey(), record.getVariableScopeKey()); }