use of org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl in project activiti-cloud by Activiti.
the class QueryProcessInstancesEntityIT method shouldGetProcessWithUpdatedInfo.
@Test
public void shouldGetProcessWithUpdatedInfo() {
// given
ProcessInstance process = processInstanceBuilder.aRunningProcessInstance("running");
eventsAggregator.sendAll();
await().untilAsserted(() -> {
// when
ResponseEntity<PagedResources<ProcessInstanceEntity>> responseEntity = executeRequestGetProcInstances();
// then
assertThat(responseEntity).isNotNull();
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
Collection<ProcessInstanceEntity> processInstanceEntities = responseEntity.getBody().getContent();
assertThat(processInstanceEntities).extracting(ProcessInstanceEntity::getId, ProcessInstanceEntity::getStatus).contains(tuple(process.getId(), ProcessInstance.ProcessInstanceStatus.RUNNING));
});
// when
ProcessInstanceImpl updatedProcess = new ProcessInstanceImpl();
updatedProcess.setId(process.getId());
updatedProcess.setBusinessKey("businessKey");
updatedProcess.setName("name");
producer.send(new CloudProcessUpdatedEventImpl(updatedProcess));
await().untilAsserted(() -> {
ResponseEntity<ProcessInstance> responseEntity = testRestTemplate.exchange(PROC_URL + "/" + process.getId(), HttpMethod.GET, keycloakTokenProducer.entityWithAuthorizationHeader(), new ParameterizedTypeReference<ProcessInstance>() {
});
// then
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(responseEntity.getBody()).isNotNull();
assertThat(responseEntity.getBody().getId()).isNotNull();
ProcessInstance responseProcess = responseEntity.getBody();
assertThat(responseProcess.getBusinessKey()).isEqualTo(updatedProcess.getBusinessKey());
assertThat(responseProcess.getName()).isEqualTo(updatedProcess.getName());
});
}
use of org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl in project activiti-cloud by Activiti.
the class ProcessUpdatedEventHandlerTest method buildProcessUpdatedEvent.
private CloudProcessUpdatedEventImpl buildProcessUpdatedEvent() {
ProcessInstanceImpl processInstance = new ProcessInstanceImpl();
processInstance.setId(UUID.randomUUID().toString());
processInstance.setBusinessKey("businesskey");
processInstance.setName("name");
return new CloudProcessUpdatedEventImpl(processInstance);
}
use of org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl 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));
}
use of org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl in project activiti-cloud by Activiti.
the class AuditServiceIT method getTestProcessStartedUpdatedCompletedEvents.
private List<CloudRuntimeEvent> getTestProcessStartedUpdatedCompletedEvents() {
List<CloudRuntimeEvent> testEvents = new ArrayList<>();
ProcessInstanceImpl processInstanceStarted = new ProcessInstanceImpl();
processInstanceStarted.setId("25");
processInstanceStarted.setProcessDefinitionId("44");
CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl("ProcessStartedEventId", System.currentTimeMillis(), processInstanceStarted);
testEvents.add(cloudProcessStartedEvent);
ProcessInstanceImpl processInstanceUpdated = new ProcessInstanceImpl();
processInstanceUpdated.setId("25");
processInstanceUpdated.setProcessDefinitionId("44");
processInstanceUpdated.setBusinessKey("businessKey");
processInstanceUpdated.setName("name");
CloudProcessUpdatedEventImpl cloudProcessUpdatedEvent = new CloudProcessUpdatedEventImpl("ProcessUpdatedEventId", System.currentTimeMillis(), processInstanceUpdated);
testEvents.add(cloudProcessUpdatedEvent);
ProcessInstanceImpl processInstanceCompleted = new ProcessInstanceImpl();
processInstanceCompleted.setId("25");
processInstanceCompleted.setProcessDefinitionId("44");
CloudProcessCompletedEventImpl cloudProcessCompletedEvent = new CloudProcessCompletedEventImpl("ProcessCompletedEventId", System.currentTimeMillis(), processInstanceCompleted);
testEvents.add(cloudProcessCompletedEvent);
return testEvents;
}
use of org.activiti.cloud.api.process.model.impl.events.CloudProcessUpdatedEventImpl in project activiti-cloud by Activiti.
the class ToCloudProcessRuntimeEventConverter method from.
public CloudProcessUpdatedEvent from(ProcessUpdatedEvent event) {
CloudProcessUpdatedEventImpl cloudEvent = new CloudProcessUpdatedEventImpl(event.getEntity());
runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudEvent);
return cloudEvent;
}
Aggregations