Search in sources :

Example 1 with CloudMessageSubscriptionCancelledEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.

the class MessageSubscriptionCancelledEventConverterTest method should_convertToAPIErrorReceivedEvent.

@Test
public void should_convertToAPIErrorReceivedEvent() {
    // given
    MessageSubscriptionCancelledAuditEventEntity auditEventEntity = (MessageSubscriptionCancelledAuditEventEntity) eventConverter.convertToEntity(createMessageSubscriptionCancelledEvent());
    CloudMessageSubscriptionCancelledEventImpl event = (CloudMessageSubscriptionCancelledEventImpl) eventConverter.convertToAPI(auditEventEntity);
    assertThatIsEqualTo(auditEventEntity, event);
}
Also used : MessageSubscriptionCancelledAuditEventEntity(org.activiti.cloud.services.audit.jpa.events.MessageSubscriptionCancelledAuditEventEntity) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) Test(org.junit.jupiter.api.Test)

Example 2 with CloudMessageSubscriptionCancelledEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.

the class MessageSubscriptionCancelledEventConverterTest method should_convert_toEntityMessageSubscriptionCancelledEvent.

@Test
public void should_convert_toEntityMessageSubscriptionCancelledEvent() {
    CloudMessageSubscriptionCancelledEventImpl event = createMessageSubscriptionCancelledEvent();
    MessageSubscriptionCancelledAuditEventEntity auditEventEntity = (MessageSubscriptionCancelledAuditEventEntity) eventConverter.convertToEntity(event);
    assertThatIsEqualTo(auditEventEntity, event);
}
Also used : MessageSubscriptionCancelledAuditEventEntity(org.activiti.cloud.services.audit.jpa.events.MessageSubscriptionCancelledAuditEventEntity) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) Test(org.junit.jupiter.api.Test)

Example 3 with CloudMessageSubscriptionCancelledEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.

the class CloudRuntimeEventRegistry method buildRegistry.

public Map<String, Class<?>> buildRegistry() {
    List<RuntimeEvent<?, ?>> eventImplementations = new ArrayList<>();
    eventImplementations.add(new CloudBPMNActivityStartedEventImpl());
    eventImplementations.add(new CloudBPMNActivityCancelledEventImpl());
    eventImplementations.add(new CloudBPMNActivityCompletedEventImpl());
    eventImplementations.add(new CloudBPMNErrorReceivedEventImpl());
    eventImplementations.add(new CloudBPMNSignalReceivedEventImpl());
    eventImplementations.add(new CloudBPMNTimerFiredEventImpl());
    eventImplementations.add(new CloudBPMNTimerCancelledEventImpl());
    eventImplementations.add(new CloudBPMNTimerScheduledEventImpl());
    eventImplementations.add(new CloudBPMNTimerExecutedEventImpl());
    eventImplementations.add(new CloudBPMNTimerFailedEventImpl());
    eventImplementations.add(new CloudBPMNTimerRetriesDecrementedEventImpl());
    eventImplementations.add(new CloudBPMNMessageWaitingEventImpl());
    eventImplementations.add(new CloudBPMNMessageReceivedEventImpl());
    eventImplementations.add(new CloudBPMNMessageSentEventImpl());
    eventImplementations.add(new CloudIntegrationRequestedEventImpl());
    eventImplementations.add(new CloudIntegrationResultReceivedEventImpl());
    eventImplementations.add(new CloudIntegrationErrorReceivedEventImpl());
    eventImplementations.add(new CloudProcessDeployedEventImpl());
    eventImplementations.add(new CloudProcessCreatedEventImpl());
    eventImplementations.add(new CloudProcessStartedEventImpl());
    eventImplementations.add(new CloudProcessCompletedEventImpl());
    eventImplementations.add(new CloudProcessCancelledEventImpl());
    eventImplementations.add(new CloudProcessSuspendedEventImpl());
    eventImplementations.add(new CloudProcessResumedEventImpl());
    eventImplementations.add(new CloudProcessUpdatedEventImpl());
    eventImplementations.add(new CloudSequenceFlowTakenEventImpl());
    eventImplementations.add(new CloudStartMessageDeployedEventImpl());
    eventImplementations.add(new CloudMessageSubscriptionCancelledEventImpl());
    eventImplementations.add(new CloudTaskCreatedEventImpl());
    eventImplementations.add(new CloudTaskUpdatedEventImpl());
    eventImplementations.add(new CloudTaskAssignedEventImpl());
    eventImplementations.add(new CloudTaskCompletedEventImpl());
    eventImplementations.add(new CloudTaskSuspendedEventImpl());
    eventImplementations.add(new CloudTaskActivatedEventImpl());
    eventImplementations.add(new CloudTaskCancelledEventImpl());
    eventImplementations.add(new CloudTaskCandidateUserAddedEventImpl());
    eventImplementations.add(new CloudTaskCandidateUserRemovedEventImpl());
    eventImplementations.add(new CloudTaskCandidateGroupAddedEventImpl());
    eventImplementations.add(new CloudTaskCandidateGroupRemovedEventImpl());
    eventImplementations.add(new CloudVariableCreatedEventImpl());
    eventImplementations.add(new CloudVariableUpdatedEventImpl());
    eventImplementations.add(new CloudVariableDeletedEventImpl());
    return eventImplementations.stream().collect(Collectors.toMap(event -> event.getEventType().name(), this::findInterface));
}
Also used : CloudBPMNMessageReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageReceivedEventImpl) CloudBPMNTimerRetriesDecrementedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerRetriesDecrementedEventImpl) CloudBPMNMessageWaitingEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageWaitingEventImpl) Arrays(java.util.Arrays) CloudTaskCreatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCreatedEventImpl) CloudProcessDeployedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessDeployedEventImpl) CloudProcessStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessStartedEventImpl) CloudProcessCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCompletedEventImpl) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) CloudVariableCreatedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableCreatedEventImpl) CloudProcessResumedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessResumedEventImpl) CloudBPMNMessageSentEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageSentEventImpl) CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl) CloudProcessCreatedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCreatedEventImpl) CloudTaskCancelledEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCancelledEventImpl) ArrayList(java.util.ArrayList) Map(java.util.Map) CloudIntegrationRequestedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationRequestedEventImpl) CloudTaskCandidateUserRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserRemovedEventImpl) CloudIntegrationErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationErrorReceivedEventImpl) CloudTaskSuspendedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskSuspendedEventImpl) CloudTaskCandidateGroupAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateGroupAddedEventImpl) CloudBPMNTimerFailedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFailedEventImpl) CloudProcessUpdatedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl) CloudBPMNTimerCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerCancelledEventImpl) CloudIntegrationResultReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationResultReceivedEventImpl) CloudSequenceFlowTakenEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudSequenceFlowTakenEventImpl) CloudBPMNSignalReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNSignalReceivedEventImpl) RuntimeEvent(org.activiti.api.model.shared.event.RuntimeEvent) CloudTaskAssignedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskAssignedEventImpl) CloudProcessCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCancelledEventImpl) CloudBPMNActivityCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCancelledEventImpl) Collectors(java.util.stream.Collectors) CloudTaskUpdatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskUpdatedEventImpl) CloudStartMessageDeployedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudStartMessageDeployedEventImpl) CloudTaskCandidateGroupRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateGroupRemovedEventImpl) List(java.util.List) CloudProcessSuspendedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessSuspendedEventImpl) CloudTaskCompletedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCompletedEventImpl) CloudVariableDeletedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableDeletedEventImpl) CloudBPMNActivityStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityStartedEventImpl) CloudBPMNMessageReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageReceivedEventImpl) CloudBPMNTimerScheduledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl) CloudTaskActivatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskActivatedEventImpl) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) CloudBPMNTimerFiredEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl) CloudVariableUpdatedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableUpdatedEventImpl) CloudBPMNActivityCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCompletedEventImpl) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) CloudBPMNActivityCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCancelledEventImpl) CloudBPMNMessageWaitingEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageWaitingEventImpl) CloudProcessResumedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessResumedEventImpl) CloudTaskAssignedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskAssignedEventImpl) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) CloudTaskCandidateGroupRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateGroupRemovedEventImpl) CloudVariableCreatedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableCreatedEventImpl) ArrayList(java.util.ArrayList) CloudBPMNTimerScheduledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) CloudIntegrationResultReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationResultReceivedEventImpl) CloudBPMNTimerFailedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFailedEventImpl) CloudTaskSuspendedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskSuspendedEventImpl) CloudTaskCancelledEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCancelledEventImpl) CloudStartMessageDeployedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudStartMessageDeployedEventImpl) CloudProcessCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCancelledEventImpl) CloudProcessSuspendedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessSuspendedEventImpl) CloudProcessCreatedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCreatedEventImpl) CloudProcessUpdatedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl) CloudBPMNActivityCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCompletedEventImpl) CloudBPMNTimerCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerCancelledEventImpl) CloudBPMNMessageSentEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageSentEventImpl) CloudVariableUpdatedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableUpdatedEventImpl) CloudSequenceFlowTakenEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudSequenceFlowTakenEventImpl) CloudIntegrationErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationErrorReceivedEventImpl) CloudBPMNActivityStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityStartedEventImpl) CloudBPMNTimerRetriesDecrementedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerRetriesDecrementedEventImpl) CloudIntegrationRequestedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationRequestedEventImpl) CloudProcessDeployedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessDeployedEventImpl) CloudProcessCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCompletedEventImpl) CloudTaskCreatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCreatedEventImpl) CloudTaskUpdatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskUpdatedEventImpl) CloudBPMNTimerFiredEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl) CloudTaskCandidateGroupAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateGroupAddedEventImpl) CloudTaskActivatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskActivatedEventImpl) CloudProcessStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessStartedEventImpl) CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl) CloudTaskCandidateUserRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserRemovedEventImpl) CloudVariableDeletedEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudVariableDeletedEventImpl) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) CloudBPMNSignalReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNSignalReceivedEventImpl) RuntimeEvent(org.activiti.api.model.shared.event.RuntimeEvent) CloudTaskCompletedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCompletedEventImpl)

Example 4 with CloudMessageSubscriptionCancelledEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.

the class AuditServiceIT method shouldGetMessageSubscriptionCancelledEvent.

@Test
public void shouldGetMessageSubscriptionCancelledEvent() {
    // given
    List<CloudRuntimeEvent> coveredEvents = new ArrayList<>();
    MessageSubscriptionImpl messageSubscription = MessageSubscriptionImpl.builder().withId("entityId").withEventName("messageName").withConfiguration("correlationKey").withProcessDefinitionId("processDefinitionId").withProcessInstanceId("processInstanceId").withBusinessKey("businessKey").build();
    CloudMessageSubscriptionCancelledEventImpl cloudEvent = CloudMessageSubscriptionCancelledEventImpl.builder().withEntity(messageSubscription).build();
    coveredEvents.add(cloudEvent);
    producer.send(coveredEvents.toArray(new CloudRuntimeEvent[coveredEvents.size()]));
    await().untilAsserted(() -> {
        // when
        Map<String, Object> filters = new HashMap<>();
        filters.put("eventType", MessageSubscriptionCancelledEvent.MessageSubscriptionEvents.MESSAGE_SUBSCRIPTION_CANCELLED.name());
        ResponseEntity<PagedResources<CloudRuntimeEvent>> eventsPagedResources = eventsRestTemplate.executeFind(filters);
        // then
        Collection<CloudRuntimeEvent> retrievedEvents = eventsPagedResources.getBody().getContent();
        assertThat(retrievedEvents).hasSize(1);
        assertThat(retrievedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getServiceName, CloudRuntimeEvent::getServiceVersion, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionId, CloudRuntimeEvent::getEntityId, event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getProcessInstanceId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getProcessDefinitionId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getEventName(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getConfiguration(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getBusinessKey()).contains(tuple(cloudEvent.getEventType(), cloudEvent.getServiceName(), cloudEvent.getServiceVersion(), cloudEvent.getProcessInstanceId(), cloudEvent.getProcessDefinitionId(), cloudEvent.getEntityId(), cloudEvent.getEntity().getId(), cloudEvent.getEntity().getProcessInstanceId(), cloudEvent.getEntity().getProcessDefinitionId(), cloudEvent.getEntity().getEventName(), cloudEvent.getEntity().getConfiguration(), cloudEvent.getEntity().getBusinessKey()));
    });
}
Also used : DirtiesContext(org.springframework.test.annotation.DirtiesContext) CloudMessageSubscriptionCancelledEvent(org.activiti.cloud.api.process.model.events.CloudMessageSubscriptionCancelledEvent) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) CloudTaskCreatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCreatedEventImpl) IgnoredRuntimeEvent(org.activiti.cloud.api.model.shared.impl.conf.IgnoredRuntimeEvent) Task(org.activiti.api.task.model.Task) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) CloudProcessStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessStartedEventImpl) CloudProcessCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCompletedEventImpl) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) Autowired(org.springframework.beans.factory.annotation.Autowired) BPMNTimerEvent(org.activiti.api.process.model.events.BPMNTimerEvent) PagedResources(org.springframework.hateoas.PagedResources) Map(java.util.Map) BPMNErrorReceivedEvent(org.activiti.api.process.model.events.BPMNErrorReceivedEvent) CloudIntegrationErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationErrorReceivedEventImpl) Awaitility.await(org.awaitility.Awaitility.await) CloudIntegrationResultReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationResultReceivedEventImpl) IntegrationContextImpl(org.activiti.api.runtime.model.impl.IntegrationContextImpl) BPMNTimerImpl(org.activiti.api.runtime.model.impl.BPMNTimerImpl) Collection(java.util.Collection) TaskImpl(org.activiti.api.task.model.impl.TaskImpl) CloudBPMNSignalReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNSignalReceivedEventImpl) CloudTaskAssignedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskAssignedEventImpl) BPMNActivityEvent(org.activiti.api.process.model.events.BPMNActivityEvent) CloudProcessCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessCancelledEventImpl) TestPropertySource(org.springframework.test.context.TestPropertySource) UUID(java.util.UUID) MessageSubscriptionCancelledEvent(org.activiti.api.process.model.events.MessageSubscriptionCancelledEvent) Test(org.junit.jupiter.api.Test) List(java.util.List) CloudRuntimeEventImpl(org.activiti.cloud.api.model.shared.impl.events.CloudRuntimeEventImpl) CloudProcessSuspendedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessSuspendedEventImpl) CloudTaskCompletedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCompletedEventImpl) CloudBPMNErrorReceivedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNErrorReceivedEvent) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ProcessDefinitionImpl(org.activiti.api.runtime.model.impl.ProcessDefinitionImpl) ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl) CloudBPMNActivityEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityEvent) CloudBPMNActivityCompletedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCompletedEventImpl) TaskCandidateUserEvent(org.activiti.api.task.model.events.TaskCandidateUserEvent) EventsRepository(org.activiti.cloud.services.audit.jpa.repository.EventsRepository) BPMNSignalImpl(org.activiti.api.runtime.model.impl.BPMNSignalImpl) CloudProcessDeployedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessDeployedEventImpl) TaskCandidateUserImpl(org.activiti.api.task.model.impl.TaskCandidateUserImpl) CloudTaskCancelledEvent(org.activiti.cloud.api.task.model.events.CloudTaskCancelledEvent) HashMap(java.util.HashMap) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) CloudTaskCancelledEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCancelledEventImpl) ArrayList(java.util.ArrayList) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) CloudTaskCreatedEvent(org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent) CloudIntegrationRequestedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudIntegrationRequestedEventImpl) CloudTaskCandidateUserRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserRemovedEventImpl) TaskRuntimeEvent(org.activiti.api.task.model.events.TaskRuntimeEvent) CloudBPMNTimerScheduledEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerScheduledEvent) CloudBPMNSignalReceivedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNSignalReceivedEvent) CloudProcessUpdatedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl) MyProducer(org.activiti.cloud.starters.test.MyProducer) Assertions.tuple(org.assertj.core.api.Assertions.tuple) CloudBPMNActivityStartedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNActivityStartedEvent) Import(org.springframework.context.annotation.Import) BPMNActivityImpl(org.activiti.api.runtime.model.impl.BPMNActivityImpl) CloudBPMNActivityCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCancelledEventImpl) TimerPayload(org.activiti.api.process.model.payloads.TimerPayload) BPMNErrorImpl(org.activiti.api.runtime.model.impl.BPMNErrorImpl) CloudTaskAssignedEvent(org.activiti.cloud.api.task.model.events.CloudTaskAssignedEvent) CloudTaskUpdatedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskUpdatedEventImpl) CloudBPMNActivityStartedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityStartedEventImpl) CloudBPMNTimerScheduledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) CloudBPMNTimerFiredEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl) ResponseEntity(org.springframework.http.ResponseEntity) MessageSubscriptionImpl(org.activiti.api.runtime.model.impl.MessageSubscriptionImpl) Collections(java.util.Collections) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) HashMap(java.util.HashMap) PagedResources(org.springframework.hateoas.PagedResources) ArrayList(java.util.ArrayList) MessageSubscriptionImpl(org.activiti.api.runtime.model.impl.MessageSubscriptionImpl) 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 CloudMessageSubscriptionCancelledEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.

the class MessageSubscriptionCancelledEventConverterTest method createMessageSubscriptionCancelledEvent.

private CloudMessageSubscriptionCancelledEventImpl createMessageSubscriptionCancelledEvent() {
    // given
    ProcessInstanceImpl processInstanceStarted = new ProcessInstanceImpl();
    processInstanceStarted.setId("processInstanceId");
    processInstanceStarted.setProcessDefinitionId("processDefinitionId");
    processInstanceStarted.setProcessDefinitionKey("processDefinitionKey");
    processInstanceStarted.setBusinessKey("businessKey");
    processInstanceStarted.setParentId("parentId");
    MessageSubscription messageSubscription = MessageSubscriptionImpl.builder().withId("entityId").withEventName("messageName").withConfiguration("correlationKey").withProcessDefinitionId(processInstanceStarted.getProcessDefinitionId()).withProcessInstanceId(processInstanceStarted.getId()).withBusinessKey(processInstanceStarted.getBusinessKey()).build();
    CloudMessageSubscriptionCancelledEventImpl event = CloudMessageSubscriptionCancelledEventImpl.builder().withEntity(messageSubscription).build();
    // Set explicitly to be sure
    event.setEntityId("entityId");
    event.setProcessInstanceId(processInstanceStarted.getId());
    event.setProcessDefinitionId(processInstanceStarted.getProcessDefinitionId());
    event.setProcessDefinitionKey(processInstanceStarted.getProcessDefinitionKey());
    event.setBusinessKey(processInstanceStarted.getBusinessKey());
    event.setParentProcessInstanceId(processInstanceStarted.getParentId());
    event.setMessageId("message-id");
    event.setSequenceNumber(0);
    return event;
}
Also used : MessageSubscription(org.activiti.api.process.model.MessageSubscription) CloudMessageSubscriptionCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl) ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl)

Aggregations

CloudMessageSubscriptionCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl)7 Test (org.junit.jupiter.api.Test)4 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 List (java.util.List)2 Map (java.util.Map)2 MessageSubscription (org.activiti.api.process.model.MessageSubscription)2 MessageSubscriptionCancelledEvent (org.activiti.api.process.model.events.MessageSubscriptionCancelledEvent)2 ProcessInstanceImpl (org.activiti.api.runtime.model.impl.ProcessInstanceImpl)2 CloudBPMNActivityCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCancelledEventImpl)2 CloudBPMNActivityCompletedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCompletedEventImpl)2 CloudBPMNActivityStartedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityStartedEventImpl)2 CloudBPMNErrorReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl)2 CloudBPMNSignalReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNSignalReceivedEventImpl)2 CloudBPMNTimerFiredEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl)2 CloudBPMNTimerScheduledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl)2 CloudIntegrationErrorReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudIntegrationErrorReceivedEventImpl)2 CloudIntegrationRequestedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudIntegrationRequestedEventImpl)2 CloudIntegrationResultReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudIntegrationResultReceivedEventImpl)2 CloudProcessCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudProcessCancelledEventImpl)2