public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final long wfInstanceKey, final Intent intent) { return receiveWorkflowInstances() .withIntent(intent) .withWorkflowInstanceKey(wfInstanceKey) .getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final long wfInstanceKey, final Intent intent) { return receiveWorkflowInstances() .withIntent(intent) .withWorkflowInstanceKey(wfInstanceKey) .getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceCommand( final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).onlyCommands().getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveElementInState( final String elementId, final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).withElementId(elementId).getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final WorkflowInstanceIntent intent, final BpmnElementType elementType) { return receiveWorkflowInstances().withIntent(intent).withElementType(elementType).getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveElementInState( final String elementId, final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).withElementId(elementId).getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceCommand( final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).onlyCommands().getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final long wfInstanceKey, final String elementId, final Intent intent) { return receiveWorkflowInstances() .withIntent(intent) .withWorkflowInstanceKey(wfInstanceKey) .withElementId(elementId) .getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final long wfInstanceKey, final String elementId, final Intent intent) { return receiveWorkflowInstances() .withIntent(intent) .withWorkflowInstanceKey(wfInstanceKey) .withElementId(elementId) .getFirst(); }
public Record<WorkflowInstanceRecordValue> receiveFirstWorkflowInstanceEvent( final long wfInstanceKey, final Intent intent, BpmnElementType elementType) { return receiveWorkflowInstances() .withIntent(intent) .withWorkflowInstanceKey(wfInstanceKey) .withElementType(elementType) .getFirst(); }
public static void assertWorkflowInstancePayload( WorkflowInstanceIntent instanceIntent, String expectedPayload) { final Record<WorkflowInstanceRecordValue> record = RecordingExporter.workflowInstanceRecords(instanceIntent).getFirst(); assertWorkflowInstancePayload(record, expectedPayload); }
public static void assertWorkflowInstancePayload( WorkflowInstanceIntent instanceIntent, String expectedPayload) { final Record<WorkflowInstanceRecordValue> record = RecordingExporter.workflowInstanceRecords(instanceIntent).getFirst(); assertWorkflowInstancePayload(record, expectedPayload); }
@Test public void shouldRejectUpdateForNonExistingWorkflowInstance() { // when final ExecuteCommandResponse response = updatePayload(-1L, MSGPACK_PAYLOAD); // then assertThat(response.getRecordType()).isEqualTo(RecordType.COMMAND_REJECTION); assertThat(response.getRejectionType()).isEqualTo(RejectionType.NOT_FOUND); final Record<WorkflowInstanceRecordValue> rejection = testClient .receiveWorkflowInstances() .onlyCommandRejections() .withIntent(WorkflowInstanceIntent.UPDATE_PAYLOAD) .getFirst(); assertThat(rejection).isNotNull(); }
private void assertThatWorkflowInstanceCompletedAfter( String elementId, WorkflowInstanceIntent intent) { final Record<WorkflowInstanceRecordValue> lastEvent = RecordingExporter.workflowInstanceRecords(intent).withElementId(elementId).getFirst(); final Record<WorkflowInstanceRecordValue> completedEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .withElementId(PROCESS_ID) .getFirst(); assertThat(completedEvent.getPosition()).isGreaterThan(lastEvent.getPosition()); } }
@Test public void shouldRejectUpdateForNonExistingWorkflowInstance() { // when final ExecuteCommandResponse response = updatePayload(-1L, MSGPACK_PAYLOAD); // then assertThat(response.getRecordType()).isEqualTo(RecordType.COMMAND_REJECTION); assertThat(response.getRejectionType()).isEqualTo(RejectionType.NOT_FOUND); final Record<WorkflowInstanceRecordValue> rejection = testClient .receiveWorkflowInstances() .onlyCommandRejections() .withIntent(WorkflowInstanceIntent.UPDATE_PAYLOAD) .getFirst(); assertThat(rejection).isNotNull(); }
private void assertThatWorkflowInstanceCompletedAfter( String elementId, WorkflowInstanceIntent intent) { final Record<WorkflowInstanceRecordValue> lastEvent = RecordingExporter.workflowInstanceRecords(intent).withElementId(elementId).getFirst(); final Record<WorkflowInstanceRecordValue> completedEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .withElementId(PROCESS_ID) .getFirst(); assertThat(completedEvent.getPosition()).isGreaterThan(lastEvent.getPosition()); } }
@Test public void shouldTriggerHandlerNodeWhenAttachedToActivity() { // given testClient.deploy(BOUNDARY_EVENT_WORKFLOW); testClient.createWorkflowInstance("process"); // when RecordingExporter.timerRecords(TimerIntent.CREATED).getFirst(); brokerRule.getClock().addTime(Duration.ofSeconds(10)); // then assertThat( RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.EVENT_TRIGGERING) .withElementId("timer") .getFirst()) .isNotNull(); }
@Test public void shouldTriggerHandlerNodeWhenAttachedToActivity() { // given testClient.deploy(BOUNDARY_EVENT_WORKFLOW); testClient.createWorkflowInstance("process"); // when RecordingExporter.timerRecords(TimerIntent.CREATED).getFirst(); brokerRule.getClock().addTime(Duration.ofSeconds(10)); // then assertThat( RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETING) .withElementId("timer") .getFirst()) .isNotNull(); }