public static void assertWorkflowInstanceRecord( String bpmnId, int version, long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(bpmnId) .hasVersion(version) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
public static void assertWorkflowInstanceRecord( String bpmnId, int version, long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(bpmnId) .hasVersion(version) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
public static void assertWorkflowInstanceRecord( long workflowKey, int version, long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(PROCESS_ID) .hasWorkflowKey(workflowKey) .hasVersion(version) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
public static void assertWorkflowInstanceRecord( long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(PROCESS_ID) .hasVersion(1) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
public static void assertWorkflowInstanceRecord( long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(PROCESS_ID) .hasVersion(1) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
public static void assertWorkflowInstanceRecord( long workflowKey, int version, long workflowInstanceKey, String elementId, Record<WorkflowInstanceRecordValue> workflowInstanceCanceledEvent) { Assertions.assertThat(workflowInstanceCanceledEvent.getValue()) .hasBpmnProcessId(PROCESS_ID) .hasWorkflowKey(workflowKey) .hasVersion(version) .hasWorkflowInstanceKey(workflowInstanceKey) .hasElementId(elementId); }
@Test public void shouldReplaceTimerStartWithNoneStart() { // when testClient.deploy(REPEATING_MODEL); assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); // then assertThat(RecordingExporter.timerRecords(TimerIntent.TRIGGERED).exists()).isTrue(); // when final BpmnModelInstance nonTimerModel = Bpmn.createExecutableProcess("process").startEvent("start_4").endEvent("end_4").done(); testClient.deploy(nonTimerModel); assertThat(RecordingExporter.deploymentRecords(DeploymentIntent.CREATED).limit(2).count()) .isEqualTo(2); brokerRule.getClock().addTime(Duration.ofSeconds(2)); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CANCELED).exists()).isTrue(); assertThat(RecordingExporter.timerRecords(TimerIntent.TRIGGERED).exists()).isTrue(); final long workflowInstanceKey = testClient.createWorkflowInstance("process"); final WorkflowInstanceRecordValue lastRecord = RecordingExporter.workflowInstanceRecords(EVENT_ACTIVATED) .withElementId("end_4") .getFirst() .getValue(); Assertions.assertThat(lastRecord) .hasVersion(2) .hasBpmnProcessId("process") .hasWorkflowInstanceKey(workflowInstanceKey); }
@Test public void shouldReplaceTimerStartWithNoneStart() { // when testClient.deploy(REPEATING_MODEL); assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); // then assertThat(RecordingExporter.timerRecords(TimerIntent.TRIGGERED).exists()).isTrue(); // when final BpmnModelInstance nonTimerModel = Bpmn.createExecutableProcess("process").startEvent("start_4").endEvent("end_4").done(); testClient.deploy(nonTimerModel); assertThat(RecordingExporter.deploymentRecords(DeploymentIntent.CREATED).limit(2).count()) .isEqualTo(2); brokerRule.getClock().addTime(Duration.ofSeconds(2)); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CANCELED).exists()).isTrue(); assertThat(RecordingExporter.timerRecords(TimerIntent.TRIGGERED).exists()).isTrue(); final long workflowInstanceKey = testClient.createWorkflowInstance("process"); final WorkflowInstanceRecordValue lastRecord = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .withElementId("end_4") .getFirst() .getValue(); Assertions.assertThat(lastRecord) .hasVersion(2) .hasBpmnProcessId("process") .hasWorkflowInstanceKey(workflowInstanceKey); }
@Test public void shouldCompleteWorkflow() { // when final ExecuteCommandResponse response = testClient.deployWithResponse(SIMPLE_MODEL); final DeploymentRecordValue deploymentRecord = testClient .receiveFirstDeploymentEvent(DeploymentIntent.CREATED, response.getKey()) .getValue(); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); final WorkflowInstanceRecordValue instanceCompleted = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .getFirst() .getValue(); Assertions.assertThat(instanceCompleted) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(deploymentRecord.getDeployedWorkflows().get(0).getWorkflowKey()); }
@Test public void shouldCompleteWorkflow() { // when final ExecuteCommandResponse response = testClient.deployWithResponse(SIMPLE_MODEL); final DeploymentRecordValue deploymentRecord = testClient .receiveFirstDeploymentEvent(DeploymentIntent.CREATED, response.getKey()) .getValue(); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); final WorkflowInstanceRecordValue instanceCompleted = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .getFirst() .getValue(); Assertions.assertThat(instanceCompleted) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(deploymentRecord.getDeployedWorkflows().get(0).getWorkflowKey()); }
.hasElementId("start_1") .hasBpmnProcessId("process") .hasVersion(workflow.getVersion()) .hasWorkflowKey(workflow.getWorkflowKey());
.hasElementId("start_1") .hasBpmnProcessId("process") .hasVersion(workflow.getVersion()) .hasWorkflowKey(workflow.getWorkflowKey());