diff options
author | Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com> | 2020-09-02 14:10:04 -0400 |
---|---|---|
committer | Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com> | 2020-09-02 16:06:01 -0400 |
commit | e170f7c258c5dd147e647139ff2553a5c0fb0325 (patch) | |
tree | 891a49c93c7799a7172d0d1f454ac88159893889 /bpmn/so-bpmn-tasks/src/main | |
parent | 43b5a2bbbe54e131981fdb96d831efc9169ddf3f (diff) |
Bpmn to cnf adapter implementation testing bpmn
BPMN changes related to CNF Adapter
Change-Id: I5b41b7b0a3dbc3036bbdce7f1f9cf62832b44c7f
Issue-ID: SO-3199
Signed-off-by: Kalkere Ramesh, Sharan <sk720x@att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapter.java | 36 |
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; + } + } +} |