aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/PnfReadyEventHandler.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/PnfReadyEventHandler.java b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/PnfReadyEventHandler.java
new file mode 100644
index 0000000000..f89b6a7a58
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/PnfReadyEventHandler.java
@@ -0,0 +1,28 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
+import org.openecomp.mso.client.dmaap.DmaapConsumer;
+import org.openecomp.mso.client.sdno.dmaap.PnfReadyEventConsumer;
+
+public class PnfReadyEventHandler {
+
+ private ExceptionUtil exceptionUtil;
+
+ private static final String TOPIC_NAME = "VES event";
+
+ public PnfReadyEventHandler() {
+ exceptionUtil = new ExceptionUtil();
+ }
+
+ public void getPnfReadyEventFromDmaap (DelegateExecution execution) throws Exception {
+ Object correlationIdVar = execution.getVariable("correlationId");
+ if (!(correlationIdVar instanceof String)) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, "correlationId variable is not String type");
+ }
+ String correlationId = (String) correlationIdVar;
+ DmaapConsumer dmaapConsumer = new PnfReadyEventConsumer(correlationId);
+ dmaapConsumer.consume();
+ // TODO inform camunda process that event has been received
+ }
+}