summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2018-03-16 14:42:35 +0100
committerRob Daugherty <rd472p@att.com>2018-03-27 22:02:47 +0000
commitce984167cd55716c8a40324c7f079ed39f5fbfd7 (patch)
tree51763e03460de2ac828382beeb288c082ff19210 /bpmn
parentb4473da1a753e63e66f5a9a3b1984fd4736273c2 (diff)
pnf ready event consumer
Change-Id: I63802ea60d318626ae32e734167d2bce602d72e4 Issue-ID: SO-466 Signed-off-by: Lukasz Muszkieta <lukasz.muszkieta@nokia.com>
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
+ }
+}