Search in sources :

Example 1 with CloudBPMNErrorReceivedEventImpl

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

the class ErrorReceivedEventConverterTest method should_convert_toEntityErrorReceivedEvent.

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

Example 2 with CloudBPMNErrorReceivedEventImpl

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

the class ErrorReceivedEventConverterTest method createErrorReceivedEvent.

private CloudBPMNErrorReceivedEventImpl createErrorReceivedEvent() {
    // given
    ProcessInstanceImpl processInstanceStarted = new ProcessInstanceImpl();
    processInstanceStarted.setId("processInstanceId");
    processInstanceStarted.setProcessDefinitionId("processDefinitionId");
    processInstanceStarted.setProcessDefinitionKey("processDefinitionKey");
    processInstanceStarted.setBusinessKey("businessKey");
    processInstanceStarted.setParentId("parentId");
    BPMNErrorImpl error = new BPMNErrorImpl("entityId");
    error.setProcessDefinitionId(processInstanceStarted.getProcessDefinitionId());
    error.setProcessInstanceId(processInstanceStarted.getId());
    error.setErrorId("errorId");
    error.setErrorCode("errorCode");
    CloudBPMNErrorReceivedEventImpl event = new CloudBPMNErrorReceivedEventImpl("eventId", System.currentTimeMillis(), error, error.getProcessDefinitionId(), error.getProcessInstanceId());
    // 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 : ProcessInstanceImpl(org.activiti.api.runtime.model.impl.ProcessInstanceImpl) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) BPMNErrorImpl(org.activiti.api.runtime.model.impl.BPMNErrorImpl)

Example 3 with CloudBPMNErrorReceivedEventImpl

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

the class ErrorReceivedEventConverterTest method should_convertToAPIErrorReceivedEvent.

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

Example 4 with CloudBPMNErrorReceivedEventImpl

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

the class ToCloudProcessRuntimeEventConverter method from.

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

Example 5 with CloudBPMNErrorReceivedEventImpl

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

the class CloudErrorProducerTest method shouldConvertErrorReceivedEventToCloudEventAndAddToAggregator.

@Test
public void shouldConvertErrorReceivedEventToCloudEventAndAddToAggregator() {
    BPMNErrorReceivedEvent eventFired = new BPMNErrorReceivedEventImpl(new BPMNErrorImpl());
    CloudBPMNErrorReceivedEvent cloudEventFired = new CloudBPMNErrorReceivedEventImpl();
    given(eventConverter.from(eventFired)).willReturn(cloudEventFired);
    cloudErrorReceivedProducer.onEvent(eventFired);
    verify(eventsAggregator).add(cloudEventFired);
}
Also used : CloudBPMNErrorReceivedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNErrorReceivedEvent) BPMNErrorReceivedEvent(org.activiti.api.process.model.events.BPMNErrorReceivedEvent) CloudBPMNErrorReceivedEvent(org.activiti.cloud.api.process.model.events.CloudBPMNErrorReceivedEvent) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) BPMNErrorReceivedEventImpl(org.activiti.api.runtime.event.impl.BPMNErrorReceivedEventImpl) CloudBPMNErrorReceivedEventImpl(org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl) BPMNErrorImpl(org.activiti.api.runtime.model.impl.BPMNErrorImpl) Test(org.junit.jupiter.api.Test)

Aggregations

CloudBPMNErrorReceivedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl)7 Test (org.junit.jupiter.api.Test)3 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 List (java.util.List)2 Map (java.util.Map)2 BPMNErrorReceivedEvent (org.activiti.api.process.model.events.BPMNErrorReceivedEvent)2 BPMNErrorImpl (org.activiti.api.runtime.model.impl.BPMNErrorImpl)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 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 CloudMessageSubscriptionCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl)2 CloudProcessCancelledEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudProcessCancelledEventImpl)2 CloudProcessCompletedEventImpl (org.activiti.cloud.api.process.model.impl.events.CloudProcessCompletedEventImpl)2