summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2020-09-09 12:47:47 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-09 12:47:47 +0000
commite3e5d135d01924fbdd0baf3b43c79a64dd1f76be (patch)
treed4b083dd16eeaa3ce02a858630712f01cb2d0fc7 /bpmn/so-bpmn-tasks/src
parent93d212ab6f6a95a4ec732bf727c306bb92c00b43 (diff)
parente170f7c258c5dd147e647139ff2553a5c0fb0325 (diff)
Merge "Bpmn to cnf adapter implementation testing bpmn"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java
new file mode 100644
index 0000000000..c21b467a95
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java
@@ -0,0 +1,36 @@
+package org.onap.so.bpmn.infrastructure.adapter.cnf.tasks;
+
+import java.io.IOException;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowAction;
+import org.onap.so.client.adapter.cnf.CnfAdapterClient;
+import org.onap.so.client.adapter.cnf.CnfAdapterClientException;
+import org.onap.so.client.adapter.cnf.entities.InstanceRequest;
+import org.onap.so.client.adapter.cnf.entities.InstanceResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Component
+public class CnfAdapter {
+
+ @Autowired
+ private CnfAdapterClient cnfAdapterClient;
+
+ private static final Logger logger = LoggerFactory.getLogger(CnfAdapter.class);
+
+ public void callCnfAdapter(DelegateExecution execution) throws Exception {
+ try {
+ final String instanceRequest = (String) execution.getVariable("instanceRequest");
+ InstanceRequest request = new ObjectMapper().readValue(instanceRequest, InstanceRequest.class);
+ InstanceResponse response = cnfAdapterClient.createVfModule(request);
+ } catch (Exception ex) {
+ logger.error("Exception in callCnfAdapter", ex);
+ throw ex;
+ }
+ }
+}