use of org.activiti.api.model.shared.event.RuntimeEvent in project Activiti by Activiti.
the class TaskRuntimeMultiInstanceIT method processWithParallelMultiInstancesOnCallActivity_should_emmit_EqualStartAndEndEvent.
@Test
public void processWithParallelMultiInstancesOnCallActivity_should_emmit_EqualStartAndEndEvent() {
ProcessInstance parentProcessInstance = processBaseRuntime.startProcessWithProcessDefinitionKey("miParallelCallActivity");
List<ProcessInstance> childrenProcess = processBaseRuntime.getChildrenProcessInstances(parentProcessInstance.getId()).getContent();
assertThat(childrenProcess).hasSize(2);
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED);
assertThat(localEventSource.getEvents(ProcessStartedEvent.class)).extracting(RuntimeEvent::getEventType, event -> event.getEntity().getId(), event -> event.getEntity().getParentId()).containsExactlyInAnyOrder(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, parentProcessInstance.getId(), null), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(0).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(1).getId(), parentProcessInstance.getId()));
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactlyInAnyOrder(tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(0).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(1).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(0).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(1).getId()));
// complete first iteration: multi instance should not complete yet
List<TaskAssignedEvent> taskAssignedEvents = localEventSource.getEvents(TaskAssignedEvent.class);
localEventSource.clearEvents();
TaskAssignedEvent taskAssignedEvent = taskAssignedEvents.get(0);
taskBaseRuntime.completeTask(taskAssignedEvent.getEntity());
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED);
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactlyInAnyOrder(tuple(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED, "User Task", taskAssignedEvent.getEntity().getProcessInstanceId()));
assertThat(localEventSource.getProcessInstanceEvents()).extracting(RuntimeEvent::getEventType, RuntimeEvent::getProcessInstanceId, event -> ((ProcessInstance) event.getEntity()).getParentId()).containsExactly(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, taskAssignedEvent.getEntity().getProcessInstanceId(), parentProcessInstance.getId()));
// complete second iteration: multi instance should complete
localEventSource.clearEvents();
taskAssignedEvent = taskAssignedEvents.get(1);
taskBaseRuntime.completeTask(taskAssignedEvent.getEntity());
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED);
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactlyInAnyOrder(tuple(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED, "User Task", taskAssignedEvent.getEntity().getProcessInstanceId()));
assertThat(localEventSource.getProcessInstanceEvents()).extracting(RuntimeEvent::getEventType, RuntimeEvent::getProcessInstanceId, event -> ((ProcessInstance) event.getEntity()).getParentId()).containsExactly(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, taskAssignedEvent.getEntity().getProcessInstanceId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, parentProcessInstance.getId(), null));
assertThat(processBaseRuntime.getProcessInstances()).isEmpty();
}
use of org.activiti.api.model.shared.event.RuntimeEvent in project Activiti by Activiti.
the class TaskRuntimeMultiInstanceIT method processWithParallelMultiInstancesOnSubProcess_should_emmitEventsAndContinueOnceCompletionConditionIsReached.
@Test
public void processWithParallelMultiInstancesOnSubProcess_should_emmitEventsAndContinueOnceCompletionConditionIsReached() {
// when
ProcessInstance processInstance = processBaseRuntime.startProcessWithProcessDefinitionKey("miParallelSubprocessCompletionCondition");
// then
List<Task> tasks = taskBaseRuntime.getTasks(processInstance);
assertThat(tasks).extracting(Task::getName).containsExactlyInAnyOrder("Task in sub-process 0", "Task in sub-process 1", "Task in sub-process 2", "Task in sub-process 3");
assertThat(localEventSource.getTaskEvents()).extracting(event -> ((Task) event.getEntity()).getName(), RuntimeEvent::getEventType).containsExactlyInAnyOrder(tuple("Task in sub-process 0", TaskRuntimeEvent.TaskEvents.TASK_CREATED), tuple("Task in sub-process 1", TaskRuntimeEvent.TaskEvents.TASK_CREATED), tuple("Task in sub-process 2", TaskRuntimeEvent.TaskEvents.TASK_CREATED), tuple("Task in sub-process 3", TaskRuntimeEvent.TaskEvents.TASK_CREATED), tuple("Task in sub-process 0", TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED), tuple("Task in sub-process 1", TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED), tuple("Task in sub-process 2", TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED), tuple("Task in sub-process 3", TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED));
assertActivityEvents("miSubProcess", BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED);
// given
Task taskToComplete = tasks.get(0);
// when first multi instance is completed: 3 remaining / completion condition not reached
localEventSource.clearEvents();
taskBaseRuntime.completeTask(taskToComplete);
// then
assertThat(localEventSource.getTaskEvents()).extracting(event -> ((Task) event.getEntity()).getName(), RuntimeEvent::getEventType).containsExactly(tuple(taskToComplete.getName(), TaskRuntimeEvent.TaskEvents.TASK_COMPLETED));
assertActivityEvents("miSubProcess", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED);
// given
taskToComplete = tasks.get(1);
// when second multi instance is completed: 2 remaining / completion condition reached
localEventSource.clearEvents();
taskBaseRuntime.completeTask(taskToComplete);
// then
assertThat(localEventSource.getTaskEvents()).extracting(event -> ((Task) event.getEntity()).getName(), RuntimeEvent::getEventType).containsExactlyInAnyOrder(tuple(taskToComplete.getName(), TaskRuntimeEvent.TaskEvents.TASK_COMPLETED), tuple(tasks.get(2).getName(), TaskRuntimeEvent.TaskEvents.TASK_CANCELLED), tuple(tasks.get(3).getName(), TaskRuntimeEvent.TaskEvents.TASK_CANCELLED));
assertActivityEvents("miSubProcess", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED, BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED);
assertThat(taskBaseRuntime.getTasks(processInstance)).isEmpty();
assertThat(localEventSource.getEvents()).extracting(RuntimeEvent::getEventType, RuntimeEvent::getProcessInstanceId).contains(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, processInstance.getId()));
}
use of org.activiti.api.model.shared.event.RuntimeEvent in project Activiti by Activiti.
the class TaskRuntimeMultiInstanceIT method processWithParallelMultiInstancesCallActivity_should_emmitEventsAndContinueOnceCompletionConditionIsReached.
@Test
public void processWithParallelMultiInstancesCallActivity_should_emmitEventsAndContinueOnceCompletionConditionIsReached() {
ProcessInstance parentProcessInstance = processBaseRuntime.startProcessWithProcessDefinitionKey("miParallelCallActivityCompletionCondition");
List<ProcessInstance> childrenProcess = processBaseRuntime.getChildrenProcessInstances(parentProcessInstance.getId()).getContent();
assertThat(childrenProcess).hasSize(4);
assertThat(localEventSource.getProcessInstanceEvents()).extracting(RuntimeEvent::getEventType, event -> ((ProcessInstance) event.getEntity()).getId(), event -> ((ProcessInstance) event.getEntity()).getParentId()).containsExactlyInAnyOrder(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, parentProcessInstance.getId(), null), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, parentProcessInstance.getId(), null), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, childrenProcess.get(0).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(0).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, childrenProcess.get(1).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(1).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, childrenProcess.get(2).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(2).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED, childrenProcess.get(3).getId(), parentProcessInstance.getId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED, childrenProcess.get(3).getId(), parentProcessInstance.getId()));
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactlyInAnyOrder(tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(0).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(1).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(2).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CREATED, "User Task", childrenProcess.get(3).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(0).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(1).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(2).getId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, "User Task", childrenProcess.get(3).getId()));
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED, BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED);
// first multi instance is completed: 3 remaining / completion condition not reached
List<TaskAssignedEvent> assignedTasksEvents = localEventSource.getEvents(TaskAssignedEvent.class);
TaskAssignedEvent taskAssignedEvent = assignedTasksEvents.get(0);
localEventSource.clearEvents();
taskBaseRuntime.completeTask(taskAssignedEvent.getEntity().getId());
assertThat(localEventSource.getProcessInstanceEvents()).extracting(RuntimeEvent::getEventType, event -> ((ProcessInstance) event.getEntity()).getId(), event -> ((ProcessInstance) event.getEntity()).getParentId()).containsExactly(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, taskAssignedEvent.getEntity().getProcessInstanceId(), parentProcessInstance.getId()));
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED, "User Task", taskAssignedEvent.getEntity().getProcessInstanceId()));
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED);
// second multi instance is completed: 2 remaining / completion condition reached
taskAssignedEvent = assignedTasksEvents.get(1);
localEventSource.clearEvents();
taskBaseRuntime.completeTask(taskAssignedEvent.getEntity().getId());
assertThat(localEventSource.getProcessInstanceEvents()).extracting(RuntimeEvent::getEventType, event -> ((ProcessInstance) event.getEntity()).getId()).containsExactlyInAnyOrder(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, taskAssignedEvent.getEntity().getProcessInstanceId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CANCELLED, assignedTasksEvents.get(2).getEntity().getProcessInstanceId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_CANCELLED, assignedTasksEvents.get(3).getEntity().getProcessInstanceId()), tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, parentProcessInstance.getId()));
assertThat(localEventSource.getTaskEvents()).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName(), event -> ((Task) event.getEntity()).getProcessInstanceId()).containsExactlyInAnyOrder(tuple(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED, "User Task", taskAssignedEvent.getEntity().getProcessInstanceId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CANCELLED, "User Task", assignedTasksEvents.get(2).getEntity().getProcessInstanceId()), tuple(TaskRuntimeEvent.TaskEvents.TASK_CANCELLED, "User Task", assignedTasksEvents.get(3).getEntity().getProcessInstanceId()));
assertActivityEvents("miCallActivity", BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED, BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED, BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED);
assertThat(processBaseRuntime.getProcessInstances()).isEmpty();
}
use of org.activiti.api.model.shared.event.RuntimeEvent in project Activiti by Activiti.
the class ProcessRuntimeBPMNMessageIT method should_not_cancelTask_when_nonInterruptedMessageReceived.
@Test
public void should_not_cancelTask_when_nonInterruptedMessageReceived() {
ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder.start().withBusinessKey("businessKey").withVariable("correlationKey", "correlationKey").withProcessDefinitionKey("messageNonInterruptingSubProcess").build());
List<Task> allTasks = taskRuntime.tasks(Pageable.of(0, 2), TaskPayloadBuilder.tasks().withProcessInstanceId(processInstance.getId()).build()).getContent();
assertThat(allTasks.size()).isEqualTo(1);
assertThat(MessageTestConfiguration.messageEvents).isNotEmpty().extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables()).contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_WAITING, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "nonInterruptedMessage", "correlationKey", processInstance.getBusinessKey(), null));
assertThat(localEventSource.getEvents()).filteredOn(event -> event.getEventType().equals(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED)).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, allTasks.get(0).getName()));
// sending the Non Interrupted Start Message to process
processRuntime.receive(MessagePayloadBuilder.receive("nonInterruptedMessage").withCorrelationKey("correlationKey").build());
// then
assertThat(MessageTestConfiguration.messageEvents).isNotEmpty().extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables()).contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_WAITING, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "nonInterruptedMessage", "correlationKey", processInstance.getBusinessKey(), null), Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_RECEIVED, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "nonInterruptedMessage", "correlationKey", processInstance.getBusinessKey(), null));
assertThat(taskBaseRuntime.getTasksByProcessInstanceId(processInstance.getId()).size()).isEqualTo(1);
assertThat(localEventSource.getEvents()).filteredOn(event -> event.getEventType().equals(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED)).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, allTasks.get(0).getName()));
localEventSource.clearEvents();
taskBaseRuntime.completeTask(allTasks.get(0).getId());
assertThat(localEventSource.getEvents()).filteredOn(event -> event.getEventType().equals(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED)).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_COMPLETED, allTasks.get(0).getName()));
assertThat(localEventSource.getEvents()).extracting(RuntimeEvent::getEventType, RuntimeEvent::getProcessInstanceId).contains(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, processInstance.getId()));
}
use of org.activiti.api.model.shared.event.RuntimeEvent in project Activiti by Activiti.
the class ProcessRuntimeBPMNMessageIT method should_cancelTask_when_interruptedMessageReceived.
@Test
public void should_cancelTask_when_interruptedMessageReceived() {
ProcessInstance processInstance = processRuntime.start(ProcessPayloadBuilder.start().withBusinessKey("businessKey").withVariable("correlationKey", "correlationKey").withProcessDefinitionKey("messageInterruptingSubProcess").build());
List<Task> allTasks = taskRuntime.tasks(Pageable.of(0, 2), TaskPayloadBuilder.tasks().withProcessInstanceId(processInstance.getId()).build()).getContent();
assertThat(allTasks.size()).isEqualTo(1);
assertThat(MessageTestConfiguration.messageEvents).isNotEmpty().extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables()).contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_WAITING, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "interruptedMessage", "correlationKey", processInstance.getBusinessKey(), null));
assertThat(localEventSource.getEvents()).filteredOn(event -> event.getEventType().equals(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED)).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED, allTasks.get(0).getName()));
// sending the Interrupted Start Message to process
processRuntime.receive(MessagePayloadBuilder.receive("interruptedMessage").withCorrelationKey("correlationKey").build());
// then
assertThat(MessageTestConfiguration.messageEvents).isNotEmpty().extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables()).contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_WAITING, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "interruptedMessage", "correlationKey", processInstance.getBusinessKey(), null), Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_RECEIVED, processInstance.getProcessDefinitionId(), processInstance.getId(), processInstance.getProcessDefinitionId(), processInstance.getId(), "interruptedMessage", "correlationKey", processInstance.getBusinessKey(), null));
// then
assertThat(taskBaseRuntime.getTasksByProcessInstanceId(processInstance.getId())).isEmpty();
assertThat(localEventSource.getEvents()).filteredOn(event -> event.getEventType().equals(TaskRuntimeEvent.TaskEvents.TASK_CANCELLED)).extracting(RuntimeEvent::getEventType, event -> ((Task) event.getEntity()).getName()).containsExactly(tuple(TaskRuntimeEvent.TaskEvents.TASK_CANCELLED, allTasks.get(0).getName()));
assertThat(localEventSource.getEvents()).extracting(RuntimeEvent::getEventType, RuntimeEvent::getProcessInstanceId).contains(tuple(ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED, processInstance.getId()));
}
Aggregations