Search in sources :

Example 1 with CloudTaskCreatedEvent

use of org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent in project activiti-cloud by Activiti.

the class TaskCreatedEventHandler method handle.

@Override
public void handle(CloudRuntimeEvent<?, ?> event) {
    CloudTaskCreatedEvent taskCreatedEvent = (CloudTaskCreatedEvent) event;
    TaskEntity queryTaskEntity = new TaskEntity(taskCreatedEvent);
    if (!queryTaskEntity.isStandalone()) {
        // Get processInstanceEntity reference proxy without database query
        ProcessInstanceEntity processInstanceEntity = entityManager.getReference(ProcessInstanceEntity.class, queryTaskEntity.getProcessInstanceId());
        queryTaskEntity.setProcessInstance(processInstanceEntity);
    }
    persistIntoDatabase(event, queryTaskEntity);
}
Also used : ProcessInstanceEntity(org.activiti.cloud.services.query.model.ProcessInstanceEntity) CloudTaskCreatedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent) TaskEntity(org.activiti.cloud.services.query.model.TaskEntity)

Example 2 with CloudTaskCreatedEvent

use of org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent in project activiti-cloud by Activiti.

the class QueryEventHandlerContextTest method handleShouldSelectHandlerBasedOnEventType.

@Test
public void handleShouldSelectHandlerBasedOnEventType() {
    // given
    CloudTaskCreatedEvent event = new CloudTaskCreatedEventImpl();
    // when
    context.handle(event);
    // then
    verify(handler).handle(event);
}
Also used : CloudTaskCreatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCreatedEventImpl) CloudTaskCreatedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent) Test(org.junit.jupiter.api.Test)

Example 3 with CloudTaskCreatedEvent

use of org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent in project activiti-cloud by Activiti.

the class AuditProducerIT method shouldProduceEventsDuringSimpleProcessExecution.

@Test
public void shouldProduceEventsDuringSimpleProcessExecution() {
    // when
    ResponseEntity<CloudProcessInstance> startProcessEntity = processInstanceRestTemplate.startProcess(ProcessPayloadBuilder.start().withProcessDefinitionKey(SIMPLE_PROCESS).withProcessDefinitionId(processDefinitionIds.get(SIMPLE_PROCESS)).withVariable("name", "peter").withName("my instance name").withBusinessKey("my business key").build());
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents = streamHandler.getLatestReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents).extracting(event -> event.getEventType().name()).containsExactly(PROCESS_CREATED.name(), VARIABLE_CREATED.name(), PROCESS_UPDATED.name(), PROCESS_STARTED.name(), ACTIVITY_STARTED.name(), /*start event*/
        BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED.name(), /*start event*/
        SEQUENCE_FLOW_TAKEN.name(), ACTIVITY_STARTED.name(), /*user task*/
        VARIABLE_CREATED.name(), /*task variable copy of proc var*/
        TASK_CANDIDATE_GROUP_ADDED.name(), TASK_CANDIDATE_USER_ADDED.name(), TASK_CREATED.name());
        assertThat(receivedEvents).filteredOn(event -> ACTIVITY_STARTED.equals(event.getEventType())).extracting(event -> ((CloudBPMNActivityStartedEvent) event).getEntity().getActivityType()).containsExactly("startEvent", "userTask");
        assertThat(receivedEvents).filteredOn(cloudRuntimeEvent -> PROCESS_CREATED.equals(cloudRuntimeEvent.getEventType())).extracting(cloudRuntimeEvent -> ((ProcessInstance) cloudRuntimeEvent.getEntity()).getBusinessKey()).containsExactly("my business key");
        assertThat(receivedEvents).filteredOn(cloudRuntimeEvent -> PROCESS_STARTED.equals(cloudRuntimeEvent.getEventType())).extracting(cloudRuntimeEvent -> ((ProcessInstance) cloudRuntimeEvent.getEntity()).getName()).containsExactly("my instance name");
        assertThat(receivedEvents).filteredOn(event -> TASK_CREATED.equals(event.getEventType())).extracting(event -> event.getProcessDefinitionVersion(), event -> event.getBusinessKey(), event -> ((CloudTaskCreatedEvent) event).getEntity().getTaskDefinitionKey(), event -> ((CloudTaskCreatedEvent) event).getEntity().getFormKey()).containsExactly(tuple(startProcessEntity.getBody().getProcessDefinitionVersion(), startProcessEntity.getBody().getBusinessKey(), "sid-CDFE7219-4627-43E9-8CA8-866CC38EBA94", "taskFormKey"));
    });
    // when
    processInstanceRestTemplate.suspend(startProcessEntity);
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents1 = streamHandler.getLatestReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents1).extracting(event -> event.getEventType().name()).containsExactly(PROCESS_SUSPENDED.name(), TASK_SUSPENDED.name());
        assertThat(receivedEvents1.get(0).getEntity()).isInstanceOf(ProcessInstance.class);
        assertThat(receivedEvents1.get(0).getProcessDefinitionKey()).isEqualTo(SIMPLE_PROCESS);
    });
    // when
    processInstanceRestTemplate.resume(startProcessEntity);
    // then
    await().untilAsserted(() -> {
        List<CloudRuntimeEvent<?, ?>> receivedEvents2 = streamHandler.getLatestReceivedEvents();
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(receivedEvents2).extracting(event -> event.getEventType().name()).containsExactly(PROCESS_RESUMED.name(), TASK_ACTIVATED.name());
        assertThat(receivedEvents2.get(0).getEntity()).isInstanceOf(ProcessInstance.class);
        assertThat(receivedEvents2.get(0).getProcessDefinitionKey()).isEqualTo(SIMPLE_PROCESS);
    });
    // when
    processInstanceRestTemplate.setVariables(startProcessEntity.getBody().getId(), Collections.singletonMap("name", "paul"));
    // then
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(streamHandler.getLatestReceivedEvents()).extracting(event -> event.getEventType().name()).containsExactly(VARIABLE_UPDATED.name());
    });
    // given
    ResponseEntity<PagedResources<CloudTask>> tasks = processInstanceRestTemplate.getTasks(startProcessEntity);
    Task task = tasks.getBody().iterator().next();
    // when
    taskRestTemplate.claim(task);
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(streamHandler.getLatestReceivedEvents()).extracting(event -> event.getEventType().name()).containsExactly(TASK_ASSIGNED.name(), TASK_UPDATED.name());
    });
    // when
    taskRestTemplate.complete(task);
    // then
    await().untilAsserted(() -> {
        assertThat(streamHandler.getReceivedHeaders()).containsKeys(ALL_REQUIRED_HEADERS);
        assertThat(streamHandler.getLatestReceivedEvents()).extracting(event -> event.getEventType().name()).containsExactly(TASK_COMPLETED.name(), TASK_CANDIDATE_GROUP_REMOVED.name(), TASK_CANDIDATE_USER_REMOVED.name(), VARIABLE_UPDATED.name(), /*task local var copied back to proc var*/
        BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED.name(), /*user task*/
        SEQUENCE_FLOW_TAKEN.name(), ACTIVITY_STARTED.name(), /*end event*/
        BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED.name(), /*end event*/
        PROCESS_COMPLETED.name());
    });
    assertThat(streamHandler.getLatestReceivedEvents()).filteredOn(event -> event.getEventType().equals(TASK_COMPLETED)).extracting(event -> ((Task) event.getEntity()).getStatus()).containsOnly(Task.TaskStatus.COMPLETED);
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) DirtiesContext(org.springframework.test.annotation.DirtiesContext) BeforeEach(org.junit.jupiter.api.BeforeEach) Task(org.activiti.api.task.model.Task) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) CloudTaskCandidateUserRemovedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCandidateUserRemovedEvent) Autowired(org.springframework.beans.factory.annotation.Autowired) VARIABLE_CREATED(org.activiti.api.model.shared.event.VariableEvent.VariableEvents.VARIABLE_CREATED) INTEGRATION_REQUESTED(org.activiti.api.process.model.events.IntegrationEvent.IntegrationEvents.INTEGRATION_REQUESTED) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ActiveProfiles(org.springframework.test.context.ActiveProfiles) CloudTask(org.activiti.cloud.api.task.model.CloudTask) PagedResources(org.springframework.hateoas.PagedResources) Map(java.util.Map) PROCESS_RESUMED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_RESUMED) ProcessInstance(org.activiti.api.process.model.ProcessInstance) Awaitility.await(org.awaitility.Awaitility.await) PROCESS_STARTED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_STARTED) CloudProcessDeployedEvent(org.activiti.cloud.api.process.model.events.CloudProcessDeployedEvent) Collection(java.util.Collection) RuntimeEvent(org.activiti.api.model.shared.event.RuntimeEvent) ApplicationElement(org.activiti.api.model.shared.model.ApplicationElement) BPMNActivityEvent(org.activiti.api.process.model.events.BPMNActivityEvent) PROCESS_COMPLETED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_COMPLETED) 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) Resource(org.springframework.hateoas.Resource) PROCESS_SUSPENDED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_SUSPENDED) Test(org.junit.jupiter.api.Test) TASK_ACTIVATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ACTIVATED) TASK_UPDATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_UPDATED) List(java.util.List) Stream(java.util.stream.Stream) TASK_CANDIDATE_USER_REMOVED(org.activiti.api.task.model.events.TaskCandidateUserEvent.TaskCandidateUserEvents.TASK_CANDIDATE_USER_REMOVED) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) CandidateGroup(org.activiti.cloud.api.process.model.impl.CandidateGroup) PROCESS_CANCELLED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_CANCELLED) ApplicationElementImpl(org.activiti.api.runtime.model.impl.ApplicationElementImpl) PROCESS_DEPLOYED(org.activiti.api.process.model.events.ProcessDefinitionEvent.ProcessDefinitionEvents.PROCESS_DEPLOYED) ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) INTEGRATION_RESULT_RECEIVED(org.activiti.api.process.model.events.IntegrationEvent.IntegrationEvents.INTEGRATION_RESULT_RECEIVED) TASK_CREATED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CREATED) CloudTaskCancelledEvent(org.activiti.cloud.api.task.model.events.CloudTaskCancelledEvent) TASK_CANDIDATE_GROUP_REMOVED(org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_REMOVED) HashMap(java.util.HashMap) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) TASK_ASSIGNED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED) ArrayList(java.util.ArrayList) Value(org.springframework.beans.factory.annotation.Value) TaskRestTemplate(org.activiti.cloud.starter.tests.helper.TaskRestTemplate) 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) CloudProcessDefinition(org.activiti.cloud.api.process.model.CloudProcessDefinition) CandidateUser(org.activiti.cloud.api.process.model.impl.CandidateUser) TASK_COMPLETED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_COMPLETED) VARIABLE_UPDATED(org.activiti.api.model.shared.event.VariableEvent.VariableEvents.VARIABLE_UPDATED) PROCESS_UPDATED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_UPDATED) TASK_CANDIDATE_USER_ADDED(org.activiti.api.task.model.events.TaskCandidateUserEvent.TaskCandidateUserEvents.TASK_CANDIDATE_USER_ADDED) Assertions.tuple(org.assertj.core.api.Assertions.tuple) TaskPayloadBuilder(org.activiti.api.task.model.builders.TaskPayloadBuilder) CloudBPMNActivityStartedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityStartedEvent) HttpMethod(org.springframework.http.HttpMethod) PROCESS_CREATED(org.activiti.api.process.model.events.ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED) TASK_CANCELLED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CANCELLED) File(java.io.File) TaskCandidateGroup(org.activiti.api.task.model.TaskCandidateGroup) HttpStatus(org.springframework.http.HttpStatus) ProcessInstanceRestTemplate(org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate) TASK_SUSPENDED(org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_SUSPENDED) ACTIVITY_COMPLETED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED) ACTIVITY_CANCELLED(org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED) TaskCandidateUser(org.activiti.api.task.model.TaskCandidateUser) ContextConfiguration(org.springframework.test.context.ContextConfiguration) Resources(org.springframework.hateoas.Resources) ResponseEntity(org.springframework.http.ResponseEntity) StartProcessPayloadBuilder(org.activiti.api.process.model.builders.StartProcessPayloadBuilder) Collections(java.util.Collections) 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) CloudProcessInstance(org.activiti.cloud.api.process.model.CloudProcessInstance) ProcessInstance(org.activiti.api.process.model.ProcessInstance) 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 CloudTaskCreatedEvent

use of org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent 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)

Aggregations

CloudTaskCreatedEvent (org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent)4 Test (org.junit.jupiter.api.Test)3 Collection (java.util.Collection)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Stream (java.util.stream.Stream)2 ProcessInstance (org.activiti.api.process.model.ProcessInstance)2 ProcessPayloadBuilder (org.activiti.api.process.model.builders.ProcessPayloadBuilder)2 ACTIVITY_CANCELLED (org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_CANCELLED)2 ACTIVITY_COMPLETED (org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_COMPLETED)2 ACTIVITY_STARTED (org.activiti.api.process.model.events.BPMNActivityEvent.ActivityEvents.ACTIVITY_STARTED)2 SEQUENCE_FLOW_TAKEN (org.activiti.api.process.model.events.SequenceFlowEvent.SequenceFlowEvents.SEQUENCE_FLOW_TAKEN)2 Task (org.activiti.api.task.model.Task)2 TASK_CANDIDATE_GROUP_ADDED (org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_ADDED)2 TASK_CANDIDATE_GROUP_REMOVED (org.activiti.api.task.model.events.TaskCandidateGroupEvent.TaskCandidateGroupEvents.TASK_CANDIDATE_GROUP_REMOVED)2 TASK_ASSIGNED (org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_ASSIGNED)2 TASK_CANCELLED (org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CANCELLED)2 TASK_COMPLETED (org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_COMPLETED)2 TASK_CREATED (org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_CREATED)2 TASK_UPDATED (org.activiti.api.task.model.events.TaskRuntimeEvent.TaskEvents.TASK_UPDATED)2