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;
}
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());
}
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());
}
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;
}
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));
}
Aggregations