@Test public void fromShouldConvertInternalProcessStartedEventToExternalEvent() { ProcessInstanceImpl processInstance = new ProcessInstanceImpl(); processInstance.setId("10"); processInstance.setProcessDefinitionId("myProcessDef"); ProcessStartedEventImpl event = new ProcessStartedEventImpl(processInstance); event.setNestedProcessDefinitionId("myParentProcessDef"); event.setNestedProcessInstanceId("2"); CloudProcessStartedEvent processStarted = converter.from(event); assertThat(processStarted).isInstanceOf(CloudProcessStartedEvent.class); assertThat(processStarted.getEntity().getId()).isEqualTo("10"); assertThat(processStarted.getEntity().getProcessDefinitionId()).isEqualTo("myProcessDef"); assertThat(processStarted.getNestedProcessDefinitionId()).isEqualTo("myParentProcessDef"); assertThat(processStarted.getNestedProcessInstanceId()).isEqualTo("2"); verify(runtimeBundleInfoAppender).appendRuntimeBundleInfoTo(ArgumentMatchers.any(CloudRuntimeEventImpl.class)); }
public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudProcessStartedEvent); return cloudProcessStartedEvent; }
ToCloudProcessRuntimeEventConverter { public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudProcessStartedEvent); return cloudProcessStartedEvent; } }
ToCloudProcessRuntimeEventConverter { public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudProcessStartedEvent); return cloudProcessStartedEvent; } ToCloudProcessRuntimeEventConverter(RuntimeBundleInfoAppender runtimeBundleInfoAppender); }
ToCloudProcessRuntimeEventConverter { public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudProcessStartedEvent); return cloudProcessStartedEvent; } ToCloudProcessRuntimeEventConverter(RuntimeBundleInfoAppender runtimeBundleInfoAppender); CloudProcessStartedEvent from(ProcessStartedEvent event); CloudProcessCreatedEvent from(ProcessCreatedEvent event); CloudProcessUpdatedEvent from(ProcessUpdatedEvent event); CloudProcessResumedEvent from(ProcessResumedEvent event); CloudProcessSuspendedEvent from(ProcessSuspendedEvent event); CloudProcessCompletedEvent from(ProcessCompletedEvent event); CloudProcessCancelledEvent from(ProcessCancelledEvent event); CloudBPMNActivityStartedEvent from(BPMNActivityStartedEvent event); CloudBPMNActivityCompletedEvent from(BPMNActivityCompletedEvent event); CloudBPMNActivityCancelledEvent from(BPMNActivityCancelledEvent event); CloudBPMNSignalReceivedEvent from(BPMNSignalReceivedEvent event); CloudSequenceFlowTakenEvent from(BPMNSequenceFlowTakenEvent event); CloudProcessDeployedEvent from(ProcessDeployedEvent event); CloudStartMessageDeployedEvent from(StartMessageDeployedEvent event); CloudMessageSubscriptionCancelledEvent from(MessageSubscriptionCancelledEvent event); CloudBPMNTimerFiredEvent from(BPMNTimerFiredEvent event); CloudBPMNTimerScheduledEvent from(BPMNTimerScheduledEvent event); CloudBPMNTimerCancelledEvent from(BPMNTimerCancelledEvent event); CloudBPMNTimerFailedEvent from(BPMNTimerFailedEvent event); CloudBPMNTimerExecutedEvent from(BPMNTimerExecutedEvent event); CloudBPMNTimerRetriesDecrementedEvent from(BPMNTimerRetriesDecrementedEvent event); CloudBPMNMessageSentEvent from(BPMNMessageSentEvent event); CloudBPMNMessageReceivedEvent from(BPMNMessageReceivedEvent event); CloudBPMNMessageWaitingEvent from(BPMNMessageWaitingEvent event); CloudBPMNErrorReceivedEvent from(BPMNErrorReceivedEvent event); }
ToCloudProcessRuntimeEventConverter { public CloudProcessStartedEvent from(ProcessStartedEvent event) { CloudProcessStartedEventImpl cloudProcessStartedEvent = new CloudProcessStartedEventImpl(event.getEntity(), event.getNestedProcessDefinitionId(), event.getNestedProcessInstanceId()); runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudProcessStartedEvent); return cloudProcessStartedEvent; } ToCloudProcessRuntimeEventConverter(RuntimeBundleInfoAppender runtimeBundleInfoAppender); CloudProcessStartedEvent from(ProcessStartedEvent event); CloudProcessCreatedEvent from(ProcessCreatedEvent event); CloudProcessUpdatedEvent from(ProcessUpdatedEvent event); CloudProcessResumedEvent from(ProcessResumedEvent event); CloudProcessSuspendedEvent from(ProcessSuspendedEvent event); CloudProcessCompletedEvent from(ProcessCompletedEvent event); CloudProcessCancelledEvent from(ProcessCancelledEvent event); CloudBPMNActivityStartedEvent from(BPMNActivityStartedEvent event); CloudBPMNActivityCompletedEvent from(BPMNActivityCompletedEvent event); CloudBPMNActivityCancelledEvent from(BPMNActivityCancelledEvent event); CloudBPMNSignalReceivedEvent from(BPMNSignalReceivedEvent event); CloudSequenceFlowTakenEvent from(BPMNSequenceFlowTakenEvent event); CloudProcessDeployedEvent from(ProcessDeployedEvent event); CloudStartMessageDeployedEvent from(StartMessageDeployedEvent event); CloudMessageSubscriptionCancelledEvent from(MessageSubscriptionCancelledEvent event); CloudBPMNTimerFiredEvent from(BPMNTimerFiredEvent event); CloudBPMNTimerScheduledEvent from(BPMNTimerScheduledEvent event); CloudBPMNTimerCancelledEvent from(BPMNTimerCancelledEvent event); CloudBPMNTimerFailedEvent from(BPMNTimerFailedEvent event); CloudBPMNTimerExecutedEvent from(BPMNTimerExecutedEvent event); CloudBPMNTimerRetriesDecrementedEvent from(BPMNTimerRetriesDecrementedEvent event); CloudBPMNMessageSentEvent from(BPMNMessageSentEvent event); CloudBPMNMessageReceivedEvent from(BPMNMessageReceivedEvent event); CloudBPMNMessageWaitingEvent from(BPMNMessageWaitingEvent event); CloudBPMNErrorReceivedEvent from(BPMNErrorReceivedEvent event);  }