public static WorkflowInstanceRecordStream workflowInstanceRecords( final WorkflowInstanceIntent intent) { return workflowInstanceRecords().withIntent(intent); }
public static WorkflowInstanceRecordStream workflowInstanceRecords( final WorkflowInstanceIntent intent) { return workflowInstanceRecords().withIntent(intent); }
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 List<Record<WorkflowInstanceRecordValue>> receiveElementInstancesInState( Intent intent, int expectedNumber) { return receiveWorkflowInstances() .withIntent(intent) .limit(expectedNumber) .collect(Collectors.toList()); }
public List<Record<WorkflowInstanceRecordValue>> receiveElementInstancesInState( Intent intent, int expectedNumber) { return receiveWorkflowInstances() .withIntent(intent) .limit(expectedNumber) .collect(Collectors.toList()); }
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 List<Record<WorkflowInstanceRecordValue>> receiveElementInstancesInState( Intent intent, BpmnElementType elementType, int expectedNumber) { return receiveWorkflowInstances() .withIntent(intent) .withElementType(elementType) .limit(expectedNumber) .collect(Collectors.toList()); }
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> receiveFirstWorkflowInstanceCommand( final WorkflowInstanceIntent intent) { return receiveWorkflowInstances().withIntent(intent).onlyCommands().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> 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(); }
@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(); }
@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(); }
@Test public void shouldPropagatePayloadOnSplit() { // given testClient.deploy(FORK_PROCESS); final byte[] payload = BufferUtil.bufferAsArray(MsgPackUtil.asMsgPack("key", "val")); // when testClient.createWorkflowInstance(PROCESS_ID, payload); // then final List<Record<WorkflowInstanceRecordValue>> taskEvents = testClient .receiveWorkflowInstances() .withIntent(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .filter(e -> isServiceTaskInProcess(e.getValue().getElementId(), FORK_PROCESS)) .limit(2) .collect(Collectors.toList()); assertThat(taskEvents) .extracting(e -> MsgPackUtil.asMsgPackReturnArray(e.getValue().getPayload())) .allSatisfy(p -> p.equals(payload)); }