1 package org.openecomp.mso.bpmn.infrastructure.scripts;
3 import org.camunda.bpm.engine.delegate.DelegateExecution;
4 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
5 import org.openecomp.mso.client.dmaap.DmaapConsumer;
6 import org.openecomp.mso.client.sdno.dmaap.PnfReadyEventConsumer;
8 public class PnfReadyEventHandler {
10 private ExceptionUtil exceptionUtil;
12 private static final String TOPIC_NAME = "VES event";
14 public PnfReadyEventHandler() {
15 exceptionUtil = new ExceptionUtil();
18 public void getPnfReadyEventFromDmaap (DelegateExecution execution) throws Exception {
19 Object correlationIdVar = execution.getVariable("correlationId");
20 if (!(correlationIdVar instanceof String)) {
21 exceptionUtil.buildAndThrowWorkflowException(execution, 500, "correlationId variable is not String type");
23 String correlationId = (String) correlationIdVar;
24 DmaapConsumer dmaapConsumer = new PnfReadyEventConsumer(correlationId);
25 dmaapConsumer.consume();
26 // TODO inform camunda process that event has been received