Search in sources :

Example 1 with ACTIVITY_COMPLETED

use of org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED in project activiti-cloud by Activiti.

the class ExclusiveGatewayAuditProducerIT method testProcessExecutionWithExclusiveGateway.

@Test
public void testProcessExecutionWithExclusiveGateway() {
    // when
    streamHandler.getAllReceivedEvents().clear();
    ResponseEntity<CloudProcessInstance> processInstance = processInstanceRestTemplate.startProcess(new StartProcessPayloadBuilder().withProcessDefinitionKey(EXCLUSIVE_GATEWAY_PROCESS).withProcessDefinitionId(processDefinitionIds.get(EXCLUSIVE_GATEWAY_PROCESS)).withVariable("input", 0).build());
    String processInstanceId = processInstance.getBody().getId();
    String processDefinitionKey = processInstance.getBody().getProcessDefinitionKey();
    // then
    Collection<CloudVariableInstance> variableCollection = processInstanceRestTemplate.getVariables(processInstance).getBody().getContent();
    assertThat(variableCollection).isNotEmpty().extracting(CloudVariableInstance::getName, CloudVariableInstance::getValue).contains(tuple("input", 0));
    // then
    CloudTask task = processInstanceRestTemplate.getTasks(processInstance).getBody().iterator().next();
    String taskId = task.getId();
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getEntityId).containsExactly(tuple(PROCESS_CREATED, processInstanceId, processInstanceId), tuple(VARIABLE_CREATED, processInstanceId, "input"), tuple(PROCESS_UPDATED, processInstanceId, processInstanceId), tuple(PROCESS_STARTED, processInstanceId, processInstanceId), tuple(ACTIVITY_STARTED, processInstanceId, "theStart"), tuple(ACTIVITY_COMPLETED, processInstanceId, "theStart"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow1"), tuple(ACTIVITY_STARTED, processInstanceId, "task1"), tuple(VARIABLE_CREATED, processInstanceId, "input"), tuple(TASK_CANDIDATE_USER_ADDED, null, "hruser"), tuple(TASK_CREATED, processInstanceId, taskId));
    });
    streamHandler.getAllReceivedEvents().clear();
    // when
    ResponseEntity<CloudTask> claimTask = taskRestTemplate.claim(task);
    assertThat(claimTask).isNotNull();
    assertThat(claimTask.getBody().getStatus()).isEqualTo(TaskStatus.ASSIGNED);
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getEntityId).contains(tuple(TASK_ASSIGNED, processInstanceId, taskId), tuple(TASK_UPDATED, processInstanceId, taskId));
    });
    streamHandler.getAllReceivedEvents().clear();
    // when
    CompleteTaskPayload completeTaskPayload = TaskPayloadBuilder.complete().withTaskId(task.getId()).withVariables(Collections.singletonMap("input", 1)).build();
    ResponseEntity<CloudTask> completeTask = taskRestTemplate.complete(task, completeTaskPayload);
    // then
    assertThat(completeTask).isNotNull();
    assertThat(completeTask.getBody().getStatus()).isEqualTo(TaskStatus.COMPLETED);
    variableCollection = processInstanceRestTemplate.getVariables(processInstance).getBody().getContent();
    assertThat(variableCollection).isNotEmpty().extracting(CloudVariableInstance::getName, CloudVariableInstance::getValue).contains(tuple("input", 1));
    task = processInstanceRestTemplate.getTasks(processInstance).getBody().iterator().next();
    String newTaskId = task.getId();
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getEntityId).contains(tuple(VARIABLE_UPDATED, processInstanceId, "input"), tuple(VARIABLE_UPDATED, processInstanceId, "input"), tuple(TASK_COMPLETED, processInstanceId, taskId), tuple(ACTIVITY_COMPLETED, processInstanceId, "task1"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow2"), tuple(ACTIVITY_STARTED, processInstanceId, "exclusiveGateway"), tuple(ACTIVITY_COMPLETED, processInstanceId, "exclusiveGateway"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow3"), tuple(ACTIVITY_STARTED, processInstanceId, "task2"), tuple(VARIABLE_CREATED, processInstanceId, "input"), tuple(TASK_CANDIDATE_USER_ADDED, null, "hruser"), tuple(TASK_CREATED, processInstanceId, newTaskId));
        assertThat(receivedEvents).filteredOn(event -> (event.getEventType().equals(ACTIVITY_STARTED) || event.getEventType().equals(ACTIVITY_COMPLETED)) && ((BPMNActivity) event.getEntity()).getActivityType().equals("exclusiveGateway")).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessDefinitionKey, event -> ((BPMNActivity) event.getEntity()).getActivityType(), event -> ((BPMNActivity) event.getEntity()).getProcessInstanceId()).contains(tuple(ACTIVITY_STARTED, processDefinitionKey, "exclusiveGateway", processInstanceId), tuple(ACTIVITY_COMPLETED, processDefinitionKey, "exclusiveGateway", processInstanceId));
    });
    streamHandler.getAllReceivedEvents().clear();
    // when
    claimTask = taskRestTemplate.claim(task);
    // then
    assertThat(claimTask).isNotNull();
    assertThat(claimTask.getBody().getStatus()).isEqualTo(TaskStatus.ASSIGNED);
    completeTaskPayload = TaskPayloadBuilder.complete().withTaskId(task.getId()).withVariables(Collections.singletonMap("input", 2)).build();
    completeTask = taskRestTemplate.complete(task, completeTaskPayload);
    // then
    assertThat(completeTask).isNotNull();
    assertThat(completeTask.getBody().getStatus()).isEqualTo(TaskStatus.COMPLETED);
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getEntityId).contains(tuple(TASK_ASSIGNED, processInstanceId, newTaskId), tuple(TASK_UPDATED, processInstanceId, newTaskId), tuple(VARIABLE_UPDATED, processInstanceId, "input"), tuple(VARIABLE_UPDATED, processInstanceId, "input"), tuple(TASK_COMPLETED, processInstanceId, newTaskId), tuple(ACTIVITY_COMPLETED, processInstanceId, "task2"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow4"), tuple(ACTIVITY_STARTED, processInstanceId, "theEnd1"), tuple(ACTIVITY_COMPLETED, processInstanceId, "theEnd1"), tuple(PROCESS_COMPLETED, processInstanceId, processInstanceId));
        assertThat(receivedEvents).filteredOn(event -> event.getEventType().equals(VARIABLE_UPDATED)).extracting(CloudRuntimeEvent::getProcessDefinitionKey, event -> ((VariableInstance) event.getEntity()).getProcessInstanceId(), event -> ((VariableInstance) event.getEntity()).isTaskVariable(), event -> ((VariableInstance) event.getEntity()).getName(), event -> ((VariableInstance) event.getEntity()).getValue()).contains(tuple(processDefinitionKey, processInstanceId, true, "input", 2), tuple(processDefinitionKey, processInstanceId, false, "input", 2));
    });
}
Also used : DirtiesContext(org.springframework.test.annotation.DirtiesContext) BeforeEach(org.junit.jupiter.api.BeforeEach) java.util(java.util) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TASK_CREATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CREATED) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) VARIABLE_CREATED(org.activiti.api.model.shared.event.VariableEvent.VariableEvents.VARIABLE_CREATED) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) ALL_REQUIRED_HEADERS(org.activiti.cloud.starter.tests.services.audit.AuditProducerIT.ALL_REQUIRED_HEADERS) TASK_ASSIGNED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED) CloudTask(org.activiti.cloud.api.task.model.CloudTask) PagedResources(org.springframework.hateoas.PagedResources) TaskRestTemplate(org.activiti.cloud.starter.tests.helper.TaskRestTemplate) ProcessEvents(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents) ACTIVITY_STARTED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED) CloudProcessDefinition(org.activiti.cloud.api.process.model.CloudProcessDefinition) TASK_COMPLETED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_COMPLETED) VARIABLE_UPDATED(org.activiti.api.model.shared.event.VariableEvent.VariableEvents.VARIABLE_UPDATED) Awaitility.await(org.awaitility.Awaitility.await) TASK_CANDIDATE_USER_ADDED(org.activiti.api.task.model.events.TaskCandidateUserEvent.TaskCandidateUserEvents.TASK_CANDIDATE_USER_ADDED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) CloudVariableInstance(org.activiti.cloud.api.model.shared.CloudVariableInstance) TaskPayloadBuilder(org.activiti.api.task.model.builders.TaskPayloadBuilder) KeycloakTokenProducer(org.activiti.cloud.services.test.identity.keycloak.interceptor.KeycloakTokenProducer) HttpMethod(org.springframework.http.HttpMethod) TestPropertySource(org.springframework.test.context.TestPropertySource) SEQUENCE_FLOW_TAKEN(org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN) TaskStatus(org.activiti.api.task.model.Task.TaskStatus) CompleteTaskPayload(org.activiti.api.task.model.payloads.CompleteTaskPayload) Test(org.junit.jupiter.api.Test) HttpStatus(org.springframework.http.HttpStatus) TASK_UPDATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_UPDATED) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) BPMNActivity(org.activiti.api.process.model.BPMNActivity) ContextConfiguration(org.springframework.test.context.ContextConfiguration) VariableInstance(org.activiti.api.model.shared.model.VariableInstance) ResponseEntity(org.springframework.http.ResponseEntity) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) TestRestTemplate(org.springframework.boot.test.web.client.TestRestTemplate) CompleteTaskPayload(org.activiti.api.task.model.payloads.CompleteTaskPayload) CloudVariableInstance(org.activiti.cloud.api.model.shared.CloudVariableInstance) BPMNActivity(org.activiti.api.process.model.BPMNActivity) CloudTask(org.activiti.cloud.api.task.model.CloudTask) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) CloudVariableInstance(org.activiti.cloud.api.model.shared.CloudVariableInstance) VariableInstance(org.activiti.api.model.shared.model.VariableInstance) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with ACTIVITY_COMPLETED

use of org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED in project activiti-cloud by Activiti.

the class SignalAuditProducerIT method testProcessExecutionWithThrowSignal.

@Test
public void testProcessExecutionWithThrowSignal() {
    // when
    streamHandler.getAllReceivedEvents().clear();
    ResponseEntity<CloudProcessInstance> processInstance = processInstanceRestTemplate.startProcess(new StartProcessPayloadBuilder().withProcessDefinitionKey("broadcastSignalEventProcess").withBusinessKey("businessKey").build());
    String processInstanceId = processInstance.getBody().getId();
    // then
    await("Broadcast Signals").untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        String startedBySignalProcessInstanceId = receivedEvents.stream().filter(it -> PROCESS_CREATED.equals(it.getEventType()) && "processWithSignalStart1".equals(it.getProcessDefinitionKey())).map(CloudRuntimeEvent::getProcessInstanceId).findFirst().orElseThrow(() -> new NoSuchElementException("processWithSignalStart1"));
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessDefinitionKey, CloudRuntimeEvent::getBusinessKey, CloudRuntimeEvent::getEntityId).contains(tuple(PROCESS_CREATED, "broadcastSignalEventProcess", "businessKey", processInstanceId), tuple(PROCESS_STARTED, "broadcastSignalEventProcess", "businessKey", processInstanceId), tuple(ACTIVITY_STARTED, "broadcastSignalEventProcess", "businessKey", "startevent1"), tuple(ACTIVITY_COMPLETED, "broadcastSignalEventProcess", "businessKey", "startevent1"), tuple(SEQUENCE_FLOW_TAKEN, "broadcastSignalEventProcess", "businessKey", "flow5"), tuple(ACTIVITY_STARTED, "broadcastSignalEventProcess", "businessKey", "signalintermediatethrowevent1"), tuple(ACTIVITY_COMPLETED, "broadcastSignalEventProcess", "businessKey", "signalintermediatethrowevent1"), tuple(SEQUENCE_FLOW_TAKEN, "broadcastSignalEventProcess", "businessKey", "flow4"), tuple(ACTIVITY_STARTED, "broadcastSignalEventProcess", "businessKey", "endevent1"), tuple(ACTIVITY_COMPLETED, "broadcastSignalEventProcess", "businessKey", "endevent1"), tuple(PROCESS_COMPLETED, "broadcastSignalEventProcess", "businessKey", processInstanceId), tuple(PROCESS_CREATED, "processWithSignalStart1", null, startedBySignalProcessInstanceId), tuple(SIGNAL_RECEIVED, "processWithSignalStart1", null, "theStart"), tuple(PROCESS_STARTED, "processWithSignalStart1", null, startedBySignalProcessInstanceId), tuple(ACTIVITY_COMPLETED, "processWithSignalStart1", null, "theStart"), tuple(SEQUENCE_FLOW_TAKEN, "processWithSignalStart1", null, "flow1"), tuple(ACTIVITY_STARTED, "processWithSignalStart1", null, "theTask"));
        runtimeService.deleteProcessInstance(startedBySignalProcessInstanceId, "clean up");
    });
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) DirtiesContext(org.springframework.test.annotation.DirtiesContext) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) ALL_REQUIRED_HEADERS(org.activiti.cloud.starter.tests.services.audit.AuditProducerIT.ALL_REQUIRED_HEADERS) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) SignalRestTemplate(org.activiti.cloud.starter.tests.helper.SignalRestTemplate) ProcessDefinitionRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessDefinitionRestTemplate) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) ACTIVITY_STARTED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED) CloudProcessDefinition(org.activiti.cloud.api.process.model.CloudProcessDefinition) NoSuchElementException(java.util.NoSuchElementException) SIGNAL_RECEIVED(org.activiti.api.process.model.events.BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED) CloudBPMNSignalReceivedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNSignalReceivedEvent) Awaitility.await(org.awaitility.Awaitility.await) PROCESS_STARTED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) PROCESS_COMPLETED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED) TestPropertySource(org.springframework.test.context.TestPropertySource) PROCESS_CREATED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED) SEQUENCE_FLOW_TAKEN(org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN) Collectors(java.util.stream.Collectors) Test(org.junit.jupiter.api.Test) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) List(java.util.List) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ContextConfiguration(org.springframework.test.context.ContextConfiguration) Optional(java.util.Optional) ResponseEntity(org.springframework.http.ResponseEntity) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) RUNTIME_BUNDLE_INFO_HEADERS(org.activiti.cloud.starter.tests.services.audit.AuditProducerIT.RUNTIME_BUNDLE_INFO_HEADERS) Collections(java.util.Collections) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) NoSuchElementException(java.util.NoSuchElementException) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with ACTIVITY_COMPLETED

use of org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED in project activiti-cloud by Activiti.

the class ParallelGatewayAuditProducerIT method testProcessExecutionWithParallelGateway.

@Test
public void testProcessExecutionWithParallelGateway() {
    // when
    streamHandler.getAllReceivedEvents().clear();
    ResponseEntity<CloudProcessInstance> processInstance = processInstanceRestTemplate.startProcess(new StartProcessPayloadBuilder().withProcessDefinitionKey(PARALLEL_GATEWAY_PROCESS).build());
    String processInstanceId = processInstance.getBody().getId();
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getAllReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getEntityId).contains(tuple(PROCESS_CREATED, processInstanceId, processInstanceId), tuple(PROCESS_STARTED, processInstanceId, processInstanceId), tuple(ACTIVITY_STARTED, processInstanceId, "theStart"), tuple(ACTIVITY_COMPLETED, processInstanceId, "theStart"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow1"), tuple(ACTIVITY_STARTED, processInstanceId, "task1"), tuple(ACTIVITY_COMPLETED, processInstanceId, "task1"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow2"), tuple(ACTIVITY_STARTED, processInstanceId, "parallelGateway"), tuple(ACTIVITY_COMPLETED, processInstanceId, "parallelGateway"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow3"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow5"), tuple(ACTIVITY_STARTED, processInstanceId, "task2"), tuple(ACTIVITY_STARTED, processInstanceId, "task3"), tuple(ACTIVITY_COMPLETED, processInstanceId, "task2"), tuple(ACTIVITY_COMPLETED, processInstanceId, "task3"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow4"), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, "flow6"), tuple(ACTIVITY_STARTED, processInstanceId, "theEnd1"), tuple(ACTIVITY_STARTED, processInstanceId, "theEnd2"), tuple(ACTIVITY_COMPLETED, processInstanceId, "theEnd1"), tuple(ACTIVITY_COMPLETED, processInstanceId, "theEnd2"), tuple(PROCESS_COMPLETED, processInstanceId, processInstanceId));
        assertThat(receivedEvents).filteredOn(event -> (event.getEventType().equals(ACTIVITY_STARTED) || event.getEventType().equals(ACTIVITY_COMPLETED)) && ((BPMNActivity) event.getEntity()).getActivityType().equals("parallelGateway")).extracting(CloudRuntimeEvent::getEventType, event -> ((BPMNActivity) event.getEntity()).getActivityType(), event -> ((BPMNActivity) event.getEntity()).getProcessInstanceId()).contains(tuple(ACTIVITY_STARTED, "parallelGateway", processInstanceId), tuple(ACTIVITY_COMPLETED, "parallelGateway", processInstanceId));
    });
}
Also used : DirtiesContext(org.springframework.test.annotation.DirtiesContext) Awaitility.await(org.awaitility.Awaitility.await) PROCESS_STARTED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) PROCESS_COMPLETED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TestPropertySource(org.springframework.test.context.TestPropertySource) PROCESS_CREATED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED) SEQUENCE_FLOW_TAKEN(org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN) ALL_REQUIRED_HEADERS(org.activiti.cloud.starter.tests.services.audit.AuditProducerIT.ALL_REQUIRED_HEADERS) Test(org.junit.jupiter.api.Test) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) List(java.util.List) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ACTIVITY_STARTED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED) BPMNActivity(org.activiti.api.process.model.BPMNActivity) ContextConfiguration(org.springframework.test.context.ContextConfiguration) ResponseEntity(org.springframework.http.ResponseEntity) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) BPMNActivity(org.activiti.api.process.model.BPMNActivity) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 4 with ACTIVITY_COMPLETED

use of org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED in project activiti-cloud by Activiti.

the class EmbeddedSubProcessAuditIT method shouldExecuteProcessWithEmbeddedSubProcess.

@Test
public void shouldExecuteProcessWithEmbeddedSubProcess() {
    // given
    ResponseEntity<CloudProcessInstance> processInstance = processInstanceRestTemplate.startProcess(buildStartProcessPayload(SIMPLE_EMBEDDED_SUB_PROCESS));
    String processInstanceId = processInstance.getBody().getId();
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getParentProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(PROCESS_CREATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(PROCESS_UPDATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(PROCESS_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(TASK_CANDIDATE_GROUP_ADDED, null, null, null), tuple(TASK_CREATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS));
        assertThat(receivedEvents).filteredOn(event -> TASK_CREATED.equals(event.getEventType())).extracting(CloudRuntimeEvent::getProcessInstanceId, event -> ((CloudTaskCreatedEvent) event).getEntity().getProcessInstanceId()).containsExactly(tuple(processInstanceId, processInstanceId));
        List<CloudRuntimeEvent<?, ?>> activitiStartedEvents = receivedEvents.stream().filter(event -> ACTIVITY_STARTED.equals(event.getEventType())).collect(Collectors.toList());
        assertThat(activitiStartedEvents).filteredOn(event -> ACTIVITY_STARTED.equals(event.getEventType())).extracting(event -> ((CloudBPMNActivityStartedEvent) event).getEntity().getActivityType(), event -> ((CloudBPMNActivityStartedEvent) event).getEntity().getActivityName()).containsExactly(tuple("startEvent", null), tuple("subProcess", "subProcess"), tuple("startEvent", null), tuple("userTask", "Task in subprocess"));
    });
    ResponseEntity<PagedResources<CloudTask>> tasks = processInstanceRestTemplate.getTasks(processInstance);
    Task task = tasks.getBody().iterator().next();
    // when
    taskRestTemplate.claim(task);
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getParentProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(TASK_ASSIGNED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(TASK_UPDATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS));
        String entityProcessInstanceId = ((CloudTaskAssignedEvent) receivedEvents.get(0)).getEntity().getProcessInstanceId();
        assertThat(entityProcessInstanceId).isNotNull();
        assertThat(entityProcessInstanceId).isEqualTo(processInstanceId);
    });
    // when
    taskRestTemplate.complete(task);
    // then
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(TASK_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(TASK_CANDIDATE_GROUP_REMOVED, null, null), tuple(ACTIVITY_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), /*subProcess*/
        tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_STARTED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(ACTIVITY_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS), tuple(PROCESS_COMPLETED, processInstanceId, SIMPLE_EMBEDDED_SUB_PROCESS));
        CloudBPMNActivityCompletedEvent subprocessCompletedEvent = (CloudBPMNActivityCompletedEvent) receivedEvents.stream().filter(event -> ACTIVITY_COMPLETED.equals(event.getEventType()) && "subProcess".equals(((CloudBPMNActivityCompletedEvent) event).getEntity().getActivityType())).collect(Collectors.toList()).get(0);
        assertThat(subprocessCompletedEvent).isNotNull();
        assertThat(subprocessCompletedEvent.getProcessInstanceId()).isEqualTo(processInstanceId);
    });
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) DirtiesContext(org.springframework.test.annotation.DirtiesContext) Task(org.activiti.api.task.model.Task) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) SignalRestTemplate(org.activiti.cloud.starter.tests.helper.SignalRestTemplate) CloudTask(org.activiti.cloud.api.task.model.CloudTask) PagedResources(org.springframework.hateoas.PagedResources) MESSAGE_SUBSCRIPTION_CANCELLED(org.activiti.api.process.model.events.MessageSubscriptionEvent.MessageSubscriptionEvents.MESSAGE_SUBSCRIPTION_CANCELLED) SIGNAL_RECEIVED(org.activiti.api.process.model.events.BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED) ProcessInstance(org.activiti.api.process.model.ProcessInstance) Awaitility.await(org.awaitility.Awaitility.await) Collection(java.util.Collection) TestPropertySource(org.springframework.test.context.TestPropertySource) SEQUENCE_FLOW_TAKEN(org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN) Collectors(java.util.stream.Collectors) Test(org.junit.jupiter.api.Test) TASK_UPDATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_UPDATED) List(java.util.List) Stream(java.util.stream.Stream) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) TASK_CREATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CREATED) TASK_CANDIDATE_GROUP_REMOVED(org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_REMOVED) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) TASK_ASSIGNED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED) Value(org.springframework.beans.factory.annotation.Value) TaskRestTemplate(org.activiti.cloud.starter.tests.helper.TaskRestTemplate) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) ProcessEvents(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents) CloudBPMNActivityCompletedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityCompletedEvent) ACTIVITY_STARTED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED) TASK_CANDIDATE_GROUP_ADDED(org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_ADDED) CloudTaskCreatedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent) MESSAGE_RECEIVED(org.activiti.api.process.model.events.BPMNMessageEvent.MessageEvents.MESSAGE_RECEIVED) CloudProcessDefinition(org.activiti.cloud.api.process.model.CloudProcessDefinition) Execution(org.activiti.engine.runtime.Execution) TASK_COMPLETED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_COMPLETED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) CloudBPMNActivityStartedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityStartedEvent) HttpMethod(org.springframework.http.HttpMethod) TASK_CANCELLED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CANCELLED) CloudTaskAssignedEvent(org.activiti.cloud.api.task.model.events.CloudTaskAssignedEvent) StartProcessPayload(org.activiti.api.process.model.payloads.StartProcessPayload) HttpStatus(org.springframework.http.HttpStatus) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) MESSAGE_WAITING(org.activiti.api.process.model.events.BPMNMessageEvent.MessageEvents.MESSAGE_WAITING) ACTIVITY_CANCELLED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED) ContextConfiguration(org.springframework.test.context.ContextConfiguration) ResponseEntity(org.springframework.http.ResponseEntity) TestRestTemplate(org.springframework.boot.test.web.client.TestRestTemplate) Task(org.activiti.api.task.model.Task) CloudTask(org.activiti.cloud.api.task.model.CloudTask) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) PagedResources(org.springframework.hateoas.PagedResources) CloudBPMNActivityCompletedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityCompletedEvent) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with ACTIVITY_COMPLETED

use of org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED in project activiti-cloud by Activiti.

the class EmbeddedSubProcessAuditIT method shouldExecuteProcessWithEmbeddedSubProcessContainingCallActivity.

@Test
public void shouldExecuteProcessWithEmbeddedSubProcessContainingCallActivity() {
    // given
    ResponseEntity<CloudProcessInstance> processInstance = processInstanceRestTemplate.startProcess(buildStartProcessPayload(SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY));
    String processInstanceId = processInstance.getBody().getId();
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getParentProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(PROCESS_CREATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(PROCESS_UPDATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(PROCESS_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(TASK_CANDIDATE_GROUP_ADDED, null, null, null), tuple(TASK_CREATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY));
        assertThat(receivedEvents).filteredOn(event -> ACTIVITY_STARTED.equals(event.getEventType())).extracting(event -> ((CloudBPMNActivityStartedEvent) event).getEntity().getActivityType(), event -> ((CloudBPMNActivityStartedEvent) event).getEntity().getActivityName()).containsExactly(tuple("startEvent", null), tuple("subProcess", "subProcess"), tuple("startEvent", null), tuple("userTask", "Task in subprocess"));
    });
    ResponseEntity<PagedResources<CloudTask>> tasks = processInstanceRestTemplate.getTasks(processInstance);
    Task task = tasks.getBody().iterator().next();
    String subProcessInstanceId = task.getProcessInstanceId();
    assertThat(subProcessInstanceId).isNotNull();
    assertThat(subProcessInstanceId).isEqualTo(processInstanceId);
    // when
    taskRestTemplate.claim(task);
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getParentProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(TASK_ASSIGNED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(TASK_UPDATED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY));
    });
    // when
    taskRestTemplate.complete(task);
    // Check we have two processes and one of them is callActivity process
    // when
    ResponseEntity<PagedResources<ProcessInstance>> processes = processInstanceRestTemplate.getSubprocesses(processInstanceId);
    assertThat(processes.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(processes.getBody()).isNotNull();
    assertThat(processes.getBody().getContent().size()).isEqualTo(1);
    assertThat(processes.getBody().getContent().iterator().next().getProcessDefinitionKey()).isEqualTo(SIMPLE_SUB_PROCESS1);
    String callActivityProcessId = processes.getBody().getContent().iterator().next().getId();
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(receivedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getParentProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionKey).containsExactly(tuple(TASK_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(TASK_CANDIDATE_GROUP_REMOVED, null, null, null), tuple(ACTIVITY_COMPLETED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(SEQUENCE_FLOW_TAKEN, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(ACTIVITY_STARTED, processInstanceId, null, SIMPLE_EMBEDDED_SUB_PROCESS_WITH_CALLACTIVITY), tuple(PROCESS_CREATED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(PROCESS_STARTED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(ACTIVITY_STARTED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(ACTIVITY_COMPLETED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(SEQUENCE_FLOW_TAKEN, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(ACTIVITY_STARTED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1), tuple(TASK_CREATED, callActivityProcessId, processInstanceId, SIMPLE_SUB_PROCESS1));
    });
    // Clean up
    runtimeService.deleteProcessInstance(callActivityProcessId, "Clean up");
    runtimeService.deleteProcessInstance(processInstanceId, "Clean up");
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) DirtiesContext(org.springframework.test.annotation.DirtiesContext) Task(org.activiti.api.task.model.Task) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) SignalRestTemplate(org.activiti.cloud.starter.tests.helper.SignalRestTemplate) CloudTask(org.activiti.cloud.api.task.model.CloudTask) PagedResources(org.springframework.hateoas.PagedResources) MESSAGE_SUBSCRIPTION_CANCELLED(org.activiti.api.process.model.events.MessageSubscriptionEvent.MessageSubscriptionEvents.MESSAGE_SUBSCRIPTION_CANCELLED) SIGNAL_RECEIVED(org.activiti.api.process.model.events.BPMNSignalEvent.SignalEvents.SIGNAL_RECEIVED) ProcessInstance(org.activiti.api.process.model.ProcessInstance) Awaitility.await(org.awaitility.Awaitility.await) Collection(java.util.Collection) TestPropertySource(org.springframework.test.context.TestPropertySource) SEQUENCE_FLOW_TAKEN(org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN) Collectors(java.util.stream.Collectors) Test(org.junit.jupiter.api.Test) TASK_UPDATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_UPDATED) List(java.util.List) Stream(java.util.stream.Stream) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) TASK_CREATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CREATED) TASK_CANDIDATE_GROUP_REMOVED(org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_REMOVED) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) TASK_ASSIGNED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED) Value(org.springframework.beans.factory.annotation.Value) TaskRestTemplate(org.activiti.cloud.starter.tests.helper.TaskRestTemplate) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) ProcessEvents(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents) CloudBPMNActivityCompletedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityCompletedEvent) ACTIVITY_STARTED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED) TASK_CANDIDATE_GROUP_ADDED(org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_ADDED) CloudTaskCreatedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent) MESSAGE_RECEIVED(org.activiti.api.process.model.events.BPMNMessageEvent.MessageEvents.MESSAGE_RECEIVED) CloudProcessDefinition(org.activiti.cloud.api.process.model.CloudProcessDefinition) Execution(org.activiti.engine.runtime.Execution) TASK_COMPLETED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_COMPLETED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) CloudBPMNActivityStartedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityStartedEvent) HttpMethod(org.springframework.http.HttpMethod) TASK_CANCELLED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CANCELLED) CloudTaskAssignedEvent(org.activiti.cloud.api.task.model.events.CloudTaskAssignedEvent) StartProcessPayload(org.activiti.api.process.model.payloads.StartProcessPayload) HttpStatus(org.springframework.http.HttpStatus) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) MESSAGE_WAITING(org.activiti.api.process.model.events.BPMNMessageEvent.MessageEvents.MESSAGE_WAITING) ACTIVITY_CANCELLED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED) ContextConfiguration(org.springframework.test.context.ContextConfiguration) ResponseEntity(org.springframework.http.ResponseEntity) TestRestTemplate(org.springframework.boot.test.web.client.TestRestTemplate) Task(org.activiti.api.task.model.Task) CloudTask(org.activiti.cloud.api.task.model.CloudTask) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) PagedResources(org.springframework.hateoas.PagedResources) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ACTIVITY_COMPLETED (org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED)7 ACTIVITY_STARTED (org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED)7 CloudRuntimeEvent (org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent)7 CloudProcessInstance (org.activiti.cloud.api.process.model.CloudProcessInstance)7 ProcessInstanceRestTemplate (org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate)7 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)7 Assertions.tuple (org.assertj.core.api.Assertions.tuple)7 Awaitility.await (org.awaitility.Awaitility.await)7 Test (org.junit.jupiter.api.Test)7 Autowired (org.springframework.beans.factory.annotation.Autowired)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 ResponseEntity (org.springframework.http.ResponseEntity)7 DirtiesContext (org.springframework.test.annotation.DirtiesContext)7 ActiveProfiles (org.springframework.test.context.ActiveProfiles)7 ContextConfiguration (org.springframework.test.context.ContextConfiguration)7 TestPropertySource (org.springframework.test.context.TestPropertySource)7 List (java.util.List)6 StartProcessPayloadBuilder (org.activiti.api.process.model.builders.StartProcessPayloadBuilder)5 SEQUENCE_FLOW_TAKEN (org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN)5 ALL_REQUIRED_HEADERS (org.activiti.cloud.starter.tests.services.audit.AuditProducerIT.ALL_REQUIRED_HEADERS)5