@Test public void shouldCreateMultipleWorkflowInstancesForDifferentBpmnProcessIds() { // given testClient.deploy(Bpmn.createExecutableProcess("foo").startEvent().endEvent().done()); testClient.deploy(Bpmn.createExecutableProcess("bar").startEvent().endEvent().done()); // when final long workflowInstanceKeyFoo = testClient.createWorkflowInstance("foo"); final long workflowInstanceKeyBar = testClient.createWorkflowInstance("bar"); // then final List<Record<WorkflowInstanceRecordValue>> workflowInstanceEvents = testClient .receiveWorkflowInstances() .filterRootScope() .withIntent(WorkflowInstanceIntent.ELEMENT_READY) .limit(2) .collect(Collectors.toList()); assertWorkflowInstanceRecord( "foo", 1, workflowInstanceKeyFoo, "foo", workflowInstanceEvents.get(0)); assertWorkflowInstanceRecord( "bar", 1, workflowInstanceKeyBar, "bar", workflowInstanceEvents.get(1)); }
@Test public void shouldCreateMultipleWorkflowInstancesForDifferentBpmnProcessIds() { // given testClient.deploy(Bpmn.createExecutableProcess("foo").startEvent().endEvent().done()); testClient.deploy(Bpmn.createExecutableProcess("bar").startEvent().endEvent().done()); // when final long workflowInstanceKeyFoo = testClient.createWorkflowInstance("foo"); final long workflowInstanceKeyBar = testClient.createWorkflowInstance("bar"); // then final List<Record<WorkflowInstanceRecordValue>> workflowInstanceEvents = testClient .receiveWorkflowInstances() .filterRootScope() .withIntent(WorkflowInstanceIntent.ELEMENT_ACTIVATING) .limit(2) .collect(Collectors.toList()); assertWorkflowInstanceRecord( "foo", 1, workflowInstanceKeyFoo, "foo", workflowInstanceEvents.get(0)); assertWorkflowInstanceRecord( "bar", 1, workflowInstanceKeyBar, "bar", workflowInstanceEvents.get(1)); }