Search in sources :

Example 1 with CloudBPMNTimerExecutedEventImpl

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

the class MapBuilder method testGraphqlSubscriptionCloudBPMNTimerEvents.

@Test
public void testGraphqlSubscriptionCloudBPMNTimerEvents() throws JsonProcessingException {
    ReplayProcessor<String> data = ReplayProcessor.create();
    keycloakTokenProducer.setKeycloakTestUser(TESTADMIN);
    final String auth = keycloakTokenProducer.authorizationHeaders().getFirst(AUTHORIZATION);
    Map<String, Object> variables = new StringObjectMapBuilder().put("appName", "default-app").put("eventTypes", Arrays.array("TIMER_SCHEDULED", "TIMER_FIRED", "TIMER_EXECUTED", "TIMER_CANCELLED", "TIMER_FAILED", "TIMER_RETRIES_DECREMENTED")).get();
    Map<String, Object> payload = new StringObjectMapBuilder().put("query", "subscription($appName: String!, $eventTypes: [EngineEventType!]) { " + "  engineEvents(appName: [$appName], eventType: $eventTypes) { " + "    processInstanceId " + "    processDefinitionId " + "    entity " + "    eventType " + "  } " + "}").put("variables", variables).get();
    GraphQLMessage start = GraphQLMessage.builder().type(GraphQLMessageType.START).id("1").payload(payload).build();
    String startMessage = objectMapper.writeValueAsString(start);
    // given
    CloudBPMNTimerScheduledEvent event1 = new CloudBPMNTimerScheduledEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    // given
    CloudBPMNTimerFiredEvent event2 = new CloudBPMNTimerFiredEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    // given
    CloudBPMNTimerExecutedEvent event3 = new CloudBPMNTimerExecutedEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    // given
    CloudBPMNTimerCancelledEvent event4 = new CloudBPMNTimerCancelledEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    // given
    CloudBPMNTimerFailedEvent event5 = new CloudBPMNTimerFailedEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    // given
    CloudBPMNTimerRetriesDecrementedEvent event6 = new CloudBPMNTimerRetriesDecrementedEventImpl("id", new Date().getTime(), new BPMNTimerImpl("timerId"), "processDefinitionId", "processInstanceId") {

        {
            setAppName("default-app");
            setServiceName("rb-my-app");
            setServiceFullName("serviceFullName");
            setServiceType("runtime-bundle");
            setServiceVersion("");
            setProcessDefinitionId("processDefinitionId");
            setProcessDefinitionKey("processDefinitionKey");
            setProcessDefinitionVersion(1);
            setBusinessKey("businessKey");
        }
    };
    WebsocketSender client = HttpClient.create().baseUrl("ws://localhost:" + port).wiretap(true).headers(h -> h.add(AUTHORIZATION, auth)).websocket(GRAPHQL_WS).uri(WS_GRAPHQL_URI);
    // start subscription
    client.handle((i, o) -> {
        o.options(NettyPipeline.SendOptions::flushOnEach).sendString(Mono.just(startMessage)).then().log("start").subscribe();
        return i.receive().asString().log("data").take(1).doOnSubscribe(s -> producerChannel.output().send(MessageBuilder.withPayload(Arrays.array(event1, event2, event3, event4, event5, event6)).setHeader("routingKey", "eventProducer").build())).delaySubscription(Duration.ofSeconds(1)).subscribeWith(data);
    }).collectList().subscribe();
    // then
    Map<String, Object> message = Maps.of("data", Maps.of("engineEvents", Arrays.array(mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_SCHEDULED").get(), mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_FIRED").get(), mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_EXECUTED").get(), mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_CANCELLED").get(), mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_FAILED").get(), mapBuilder().put("processInstanceId", "processInstanceId").put("processDefinitionId", "processDefinitionId").put("entity", new BPMNTimerImpl("timerId")).put("eventType", "TIMER_RETRIES_DECREMENTED").get())));
    String dataMessage = objectMapper.writeValueAsString(GraphQLMessage.builder().type(GraphQLMessageType.DATA).id("1").payload(message).build());
    StepVerifier.create(data).expectNext(dataMessage).expectComplete().verify(TIMEOUT);
}
Also used : CloudBPMNTimerExecutedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerExecutedEvent) CloudBPMNTimerCancelledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerCancelledEventImpl) CloudBPMNTimerScheduledEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl) CloudBPMNTimerRetriesDecrementedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerRetriesDecrementedEventImpl) GraphQLMessage(org.activiti.cloud.services.notifications.graphql.ws.api.GraphQLMessage) Date(java.util.Date) CloudBPMNTimerRetriesDecrementedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerRetriesDecrementedEvent) CloudBPMNTimerFailedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFailedEventImpl) CloudBPMNTimerFiredEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl) CloudBPMNTimerFailedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerFailedEvent) CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl) CloudBPMNTimerScheduledEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerScheduledEvent) BPMNTimerImpl(org.activiti.api.runtime.model.impl.BPMNTimerImpl) CloudBPMNTimerFiredEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerFiredEvent) CloudBPMNTimerCancelledEvent(org.activiti.cloud.api.process.model.events.CloudBPMNTimerCancelledEvent) WebsocketSender(reactor.netty.http.client.HttpClient.WebsocketSender) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with CloudBPMNTimerExecutedEventImpl

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

the class ToCloudProcessRuntimeEventConverter method from.

public CloudBPMNTimerExecutedEvent from(BPMNTimerExecutedEvent event) {
    CloudBPMNTimerExecutedEventImpl cloudEvent = new CloudBPMNTimerExecutedEventImpl(event.getEntity(), event.getEntity().getProcessDefinitionId(), event.getEntity().getProcessInstanceId());
    runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudEvent);
    return cloudEvent;
}
Also used : CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl)

Example 3 with CloudBPMNTimerExecutedEventImpl

use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl 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 CloudBPMNTimerExecutedEventImpl

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

the class TimerEventConverterTest method createTimerExecutedEvent.

private CloudBPMNTimerExecutedEventImpl createTimerExecutedEvent() {
    // given
    ProcessInstanceImpl processInstance = createProcess();
    BPMNTimerImpl timer = createBPMNTimer(processInstance);
    CloudBPMNTimerExecutedEventImpl event = new CloudBPMNTimerExecutedEventImpl("eventId", System.currentTimeMillis(), timer, timer.getProcessDefinitionId(), timer.getProcessInstanceId());
    appendEventInfo(event, processInstance);
    return event;
}
Also used : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl) CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl) BPMNTimerImpl(org.activiti.api.runtime.model.impl.BPMNTimerImpl)

Example 5 with CloudBPMNTimerExecutedEventImpl

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

the class TimerEventConverterTest method checkConvertToAPITimerExecutedEvent.

@Test
public void checkConvertToAPITimerExecutedEvent() {
    // given
    TimerExecutedAuditEventEntity auditEventEntity = (TimerExecutedAuditEventEntity) eventConverterTimerExecuted.convertToEntity(createTimerExecutedEvent());
    // when
    CloudBPMNTimerExecutedEventImpl cloudEvent = (CloudBPMNTimerExecutedEventImpl) eventConverterTimerExecuted.convertToAPI(auditEventEntity);
    checkCloudAuditEvententity(auditEventEntity, cloudEvent);
}
Also used : TimerExecutedAuditEventEntity(org.activiti.cloud.services.audit.jpa.events.TimerExecutedAuditEventEntity) CloudBPMNTimerExecutedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl) Test(org.junit.jupiter.api.Test)

Aggregations

CloudBPMNTimerExecutedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerExecutedEventImpl)6 Test (org.junit.jupiter.api.Test)3 BPMNTimerImpl (org.activiti.api.runtime.model.impl.BPMNTimerImpl)2 CloudBPMNTimerCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerCancelledEventImpl)2 CloudBPMNTimerFailedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFailedEventImpl)2 CloudBPMNTimerFiredEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerFiredEventImpl)2 CloudBPMNTimerRetriesDecrementedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerRetriesDecrementedEventImpl)2 CloudBPMNTimerScheduledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNTimerScheduledEventImpl)2 TimerExecutedAuditEventEntity (org.activiti.cloud.services.audit.jpa.events.TimerExecutedAuditEventEntity)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Date (java.util.Date)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 RuntimeEvent (org.activiti.api.model.shared.event.RuntimeEvent)1 ProcessInstanceImpl (org.activiti.api.runtime.model.impl.ProcessInstanceImpl)1 CloudVariableCreatedEventImpl (org.activiti.cloud.api.model.shared.impl.events.CloudVariableCreatedEventImpl)1 CloudVariableDeletedEventImpl (org.activiti.cloud.api.model.shared.impl.events.CloudVariableDeletedEventImpl)1 CloudVariableUpdatedEventImpl (org.activiti.cloud.api.model.shared.impl.events.CloudVariableUpdatedEventImpl)1