Search in sources :

Example 1 with CloudTaskCandidateUserAddedEventImpl

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

the class AuditServiceIT method getTestUserCandidatesEvents.

private List<CloudRuntimeEvent> getTestUserCandidatesEvents() {
    List<CloudRuntimeEvent> testEvents = new ArrayList<>();
    TaskCandidateUserImpl taskCandidateUser = new TaskCandidateUserImpl("userId", "1234-abc-5678-def");
    CloudTaskCandidateUserAddedEventImpl candidateUserAddedEvent = new CloudTaskCandidateUserAddedEventImpl("TaskCandidateUserAddedEventId", System.currentTimeMillis(), taskCandidateUser);
    testEvents.add(candidateUserAddedEvent);
    taskCandidateUser = new TaskCandidateUserImpl("userId", "1234-abc-5678-def");
    CloudTaskCandidateUserRemovedEventImpl candidateUserRemovedEvent = new CloudTaskCandidateUserRemovedEventImpl("TaskCandidateUserRemovedEventId", System.currentTimeMillis(), taskCandidateUser);
    testEvents.add(candidateUserRemovedEvent);
    return testEvents;
}
Also used : TaskCandidateUserImpl(org.activiti.api.task.model.impl.TaskCandidateUserImpl) ArrayList(java.util.ArrayList) CloudTaskCandidateUserRemovedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserRemovedEventImpl) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent)

Example 2 with CloudTaskCandidateUserAddedEventImpl

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

the class TaskCandidateUserAddedEventConverterTest method checkConvertToAPITaskCandidateUserAddedEvent.

@Test
public void checkConvertToAPITaskCandidateUserAddedEvent() {
    // given
    AuditEventEntity auditEventEntity = eventConverter.convertToEntity(createTaskCandidateUserAddedEvent());
    // when
    CloudRuntimeEvent cloudEvent = eventConverter.convertToAPI(auditEventEntity);
    assertThat(cloudEvent).isNotNull();
    assertThat(((TaskCandidateUserAddedEventEntity) auditEventEntity).getCandidateUser().getTaskId()).isEqualTo(((CloudTaskCandidateUserAddedEventImpl) cloudEvent).getEntity().getTaskId());
    assertThat(((TaskCandidateUserAddedEventEntity) auditEventEntity).getCandidateUser().getUserId()).isEqualTo(((CloudTaskCandidateUserAddedEventImpl) cloudEvent).getEntity().getUserId());
    assertThat(auditEventEntity.getEntityId()).isEqualTo(cloudEvent.getEntityId());
    assertThat(auditEventEntity.getProcessInstanceId()).isEqualTo(cloudEvent.getProcessInstanceId());
    assertThat(auditEventEntity.getProcessDefinitionId()).isEqualTo(cloudEvent.getProcessDefinitionId());
    assertThat(auditEventEntity.getProcessDefinitionKey()).isEqualTo(cloudEvent.getProcessDefinitionKey());
    assertThat(auditEventEntity.getBusinessKey()).isEqualTo(cloudEvent.getBusinessKey());
    assertThat(auditEventEntity.getParentProcessInstanceId()).isEqualTo(cloudEvent.getParentProcessInstanceId());
}
Also used : AuditEventEntity(org.activiti.cloud.services.audit.jpa.events.AuditEventEntity) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) CloudRuntimeEvent(org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent) Test(org.junit.jupiter.api.Test)

Example 3 with CloudTaskCandidateUserAddedEventImpl

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

the class TaskEntityCandidateUserAddedEventHandlerTest method handleShouldStoreNewTaskCandidateUser.

@Test
public void handleShouldStoreNewTaskCandidateUser() {
    // given
    TaskCandidateUserImpl candidateUser = new TaskCandidateUserImpl(UUID.randomUUID().toString(), UUID.randomUUID().toString());
    CloudTaskCandidateUserAddedEventImpl event = new CloudTaskCandidateUserAddedEventImpl(candidateUser);
    // when
    handler.handle(event);
    // then
    ArgumentCaptor<TaskCandidateUser> captor = ArgumentCaptor.forClass(TaskCandidateUser.class);
    verify(taskCandidateRepository).save(captor.capture());
    assertThat(captor.getValue().getTaskId()).isEqualTo(event.getEntity().getTaskId());
    assertThat(captor.getValue().getUserId()).isEqualTo(event.getEntity().getUserId());
}
Also used : TaskCandidateUserImpl(org.activiti.api.task.model.impl.TaskCandidateUserImpl) CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl) TaskCandidateUser(org.activiti.cloud.services.query.model.TaskCandidateUser) Test(org.junit.jupiter.api.Test)

Example 4 with CloudTaskCandidateUserAddedEventImpl

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

the class ToCloudTaskRuntimeEventConverter method from.

public CloudTaskCandidateUserAddedEvent from(TaskCandidateUserAddedEvent event) {
    CloudTaskCandidateUserAddedEventImpl cloudEvent = new CloudTaskCandidateUserAddedEventImpl(event.getEntity());
    runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudEvent);
    return cloudEvent;
}
Also used : CloudTaskCandidateUserAddedEventImpl(org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl)

Example 5 with CloudTaskCandidateUserAddedEventImpl

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

Aggregations

CloudTaskCandidateUserAddedEventImpl (org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserAddedEventImpl)8 TaskCandidateUserImpl (org.activiti.api.task.model.impl.TaskCandidateUserImpl)4 Test (org.junit.jupiter.api.Test)4 CloudTaskCandidateUserRemovedEventImpl (org.activiti.cloud.api.task.model.impl.events.CloudTaskCandidateUserRemovedEventImpl)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 CloudRuntimeEvent (org.activiti.cloud.api.model.shared.events.CloudRuntimeEvent)2 Arrays (java.util.Arrays)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 RuntimeEvent (org.activiti.api.model.shared.event.RuntimeEvent)1 Task (org.activiti.api.task.model.Task)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 CloudBPMNActivityCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCancelledEventImpl)1 CloudBPMNActivityCompletedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityCompletedEventImpl)1 CloudBPMNActivityStartedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNActivityStartedEventImpl)1 CloudBPMNErrorReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl)1 CloudBPMNMessageReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNMessageReceivedEventImpl)1