aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-03-28 17:59:09 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-28 17:59:09 +0000
commit8f394febaf7423e6ea66007565f8aeebe23991e6 (patch)
treee9dd30e26a2f7d4908790ec778570cffcfd09b0e /bpmn/MSOInfrastructureBPMN
parent35a1423d200962910d508a8f9a0daba9d6c668d2 (diff)
parentce984167cd55716c8a40324c7f079ed39f5fbfd7 (diff)
Merge "pnf ready event consumer"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN')
-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
+ }
+}