public WorkflowInstanceRecordStream withElementType(BpmnElementType elementType) { return valueFilter(v -> v.getBpmnElementType() == elementType); }
/** * Verifies that the actual WorkflowInstanceRecordValue's bpmnElementType is equal to the given one. * @param bpmnElementType the given bpmnElementType to compare the actual WorkflowInstanceRecordValue's bpmnElementType to. * @return this assertion object. * @throws AssertionError - if the actual WorkflowInstanceRecordValue's bpmnElementType is not equal to the given one. */ public S hasBpmnElementType(io.zeebe.protocol.BpmnElementType bpmnElementType) { // check that actual WorkflowInstanceRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting bpmnElementType of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check io.zeebe.protocol.BpmnElementType actualBpmnElementType = actual.getBpmnElementType(); if (!Objects.areEqual(actualBpmnElementType, bpmnElementType)) { failWithMessage(assertjErrorMessage, actual, bpmnElementType, actualBpmnElementType); } // return the current assertion for method chaining return myself; }
@Test public void test() { // given testClient.deploy(scenario.modelInstance()); // when scenario.executeInstance(); // then final List<Record<WorkflowInstanceRecordValue>> records = RecordingExporter.workflowInstanceRecords() .withBpmnProcessId(scenario.processId()) .limitToWorkflowInstanceCompleted() .withElementId(scenario.elementId()) .asList(); assertThat(records) .extracting(r -> r.getValue().getBpmnElementType()) .isNotEmpty() .containsOnly(scenario.elementType()); }
@Test public void test() { // given testClient.deploy(scenario.modelInstance()); // when scenario.executeInstance(); // then final List<Record<WorkflowInstanceRecordValue>> records = RecordingExporter.workflowInstanceRecords() .withBpmnProcessId(scenario.processId()) .limitToWorkflowInstanceCompleted() .withElementId(scenario.elementId()) .asList(); assertThat(records) .extracting(r -> r.getValue().getBpmnElementType()) .isNotEmpty() .containsOnly(scenario.elementType()); }
r -> r.getMetadata().getIntent() == WorkflowInstanceIntent.ELEMENT_ACTIVATED && r.getValue().getBpmnElementType() == BpmnElementType.SERVICE_TASK) .collect(Collectors.toList());
r -> r.getMetadata().getIntent() == WorkflowInstanceIntent.ELEMENT_ACTIVATED && r.getValue().getBpmnElementType() == BpmnElementType.EVENT_BASED_GATEWAY) .limitToWorkflowInstanceCompleted())
r -> r.getMetadata().getIntent() == ELEMENT_COMPLETED && r.getValue().getBpmnElementType() == BpmnElementType.EXCLUSIVE_GATEWAY) .limitToWorkflowInstanceCompleted() .collect(Collectors.toList());