public WorkflowInstanceRecordStream withFlowScopeKey(final long flowScopeKey) { return valueFilter(v -> v.getFlowScopeKey() == flowScopeKey); }
@Test public void shouldResolveIncidentForInputMappingFailure() { // given testClient.deploy(WORKFLOW_INPUT_MAPPING); final long workflowInstanceKey = testClient.createWorkflowInstance("process"); final Record<WorkflowInstanceRecordValue> failureEvent = testClient.receiveElementInState("failingTask", WorkflowInstanceIntent.ELEMENT_ACTIVATING); final Record<IncidentRecordValue> incidentEvent = testClient.receiveFirstIncidentEvent(IncidentIntent.CREATED); // when testClient.updatePayload(failureEvent.getValue().getFlowScopeKey(), PAYLOAD); testClient.resolveIncident(incidentEvent.getKey()); // then final Record<WorkflowInstanceRecordValue> followUpEvent = testClient.receiveElementInState("failingTask", WorkflowInstanceIntent.ELEMENT_ACTIVATED); assertWorkflowInstancePayload(followUpEvent, "{'foo':'bar'}"); final Record incidentResolveCommand = testClient.receiveFirstIncidentCommand(RESOLVE); final Record incidentResolvedEvent = testClient.receiveFirstIncidentEvent(RESOLVED); assertThat(incidentResolvedEvent.getKey()).isEqualTo(incidentEvent.getKey()); assertThat(incidentResolveCommand.getPosition()) .isEqualTo(followUpEvent.getSourceRecordPosition()); assertThat(incidentResolveCommand.getPosition()) .isEqualTo(incidentResolvedEvent.getSourceRecordPosition()); assertIOMappingIncidentWithNoData(workflowInstanceKey, followUpEvent, incidentResolvedEvent); }
.withIntent(WorkflowInstanceIntent.ELEMENT_ACTIVATING) .getFirst(); assertThat(subProcessReady.getValue().getFlowScopeKey()).isEqualTo(workflowInstanceKey); .withIntent(WorkflowInstanceIntent.ELEMENT_ACTIVATING) .getFirst(); assertThat(subProcessTaskReady.getValue().getFlowScopeKey()) .isEqualTo(subProcessReady.getKey());
failureEvent.getValue().getFlowScopeKey(), "{'string':{'obj':'test'}}"); testClient.resolveIncident(incidentEvent.getKey());