public Record<IncidentRecordValue> receiveFirstIncidentEvent( final long wfInstanceKey, final Intent intent) { return receiveIncidents().withIntent(intent).withWorkflowInstanceKey(wfInstanceKey).getFirst(); }
@Override protected IncidentRecordStream supply(final Stream<Record<IncidentRecordValue>> wrappedStream) { return new IncidentRecordStream(wrappedStream); }
public Record<IncidentRecordValue> receiveFirstIncidentCommand(final IncidentIntent intent) { return receiveIncidents().withIntent(intent).onlyCommands().getFirst(); }
public Record<IncidentRecordValue> receiveFirstIncidentEvent(final IncidentIntent intent) { return receiveIncidents().withIntent(intent).getFirst(); }
@Test public void shouldResolveIncidentIfCorrelationKeyNotFound() { // given final long workflowInstance = testClient.createWorkflowInstance(PROCESS_ID); final Record<IncidentRecordValue> incidentCreatedRecord = RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst(); testClient.updatePayload( incidentCreatedRecord.getValue().getElementInstanceKey(), "{\"orderId\":\"order123\"}"); // when testClient.resolveIncident(incidentCreatedRecord.getKey()); // then assertThat( RecordingExporter.workflowInstanceSubscriptionRecords( WorkflowInstanceSubscriptionIntent.OPENED) .exists()) .isTrue(); final Record<IncidentRecordValue> incidentResolvedEvent = testClient.receiveFirstIncidentEvent(workflowInstance, RESOLVED); assertThat(incidentResolvedEvent.getKey()).isEqualTo(incidentCreatedRecord.getKey()); } }
testClient .receiveIncidents() .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED) .withIntent(IncidentIntent.CREATED) .getFirst(); testClient .receiveIncidents() .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED) .skipUntil(e -> e.getMetadata().getIntent() == CREATED) .withIntent(RESOLVED) .getFirst();
testClient .receiveIncidents() .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .withIntent(IncidentIntent.CREATED) .getFirst(); testClient .receiveIncidents() .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.CREATED) .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .collect(Collectors.toList());
public static IncidentRecordStream incidentRecords(final IncidentIntent intent) { return incidentRecords().withIntent(intent); }
public IncidentRecordStream withErrorMessage(final String errorMessage) { return valueFilter(v -> errorMessage.equals(v.getErrorMessage())); }
public IncidentRecordStream receiveIncidents() { return RecordingExporter.incidentRecords().withPartitionId(partitionId); }
@Test public void shouldResolveIncidentIfCorrelationKeyNotFound() { // given final long workflowInstance = testClient.createWorkflowInstance(PROCESS_ID); final Record<IncidentRecordValue> incidentCreatedRecord = RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst(); testClient.updatePayload( incidentCreatedRecord.getValue().getElementInstanceKey(), "{\"orderId\":\"order123\"}"); // when testClient.resolveIncident(incidentCreatedRecord.getKey()); // then assertThat( RecordingExporter.workflowInstanceSubscriptionRecords( WorkflowInstanceSubscriptionIntent.OPENED) .exists()); final Record<IncidentRecordValue> incidentResolvedEvent = testClient.receiveFirstIncidentEvent(workflowInstance, RESOLVED); assertThat(incidentResolvedEvent.getKey()).isEqualTo(incidentCreatedRecord.getKey()); } }
testClient .receiveIncidents() .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED) .withIntent(IncidentIntent.CREATED) .getFirst(); testClient .receiveIncidents() .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED) .skipUntil(e -> e.getMetadata().getIntent() == CREATED) .withIntent(RESOLVED) .getFirst();
testClient .receiveIncidents() .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .withIntent(IncidentIntent.CREATED) .getFirst(); testClient .receiveIncidents() .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.CREATED) .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED) .collect(Collectors.toList());
public Record<IncidentRecordValue> receiveFirstIncidentEvent(final IncidentIntent intent) { return receiveIncidents().withIntent(intent).getFirst(); }
public static IncidentRecordStream incidentRecords(final IncidentIntent intent) { return incidentRecords().withIntent(intent); }
public IncidentRecordStream withBpmnProcessId(final String bpmnProcessId) { return valueFilter(v -> bpmnProcessId.equals(v.getBpmnProcessId())); }
public IncidentRecordStream receiveIncidents() { return RecordingExporter.incidentRecords().withPartitionId(partitionId); }
RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst(); clientRule .getClient()