fixed typos and added SERVICE_INSTANCE_ID 76/88376/3
authormarios.iakovidis <marios.iakovidis@huawei.com>
Thu, 23 May 2019 15:29:10 +0000 (18:29 +0300)
committermarios.iakovidis <marios.iakovidis@huawei.com>
Mon, 27 May 2019 08:17:47 +0000 (11:17 +0300)
Change-Id: I68174bf2e67280a4bf65d8f26b04793b76896f04
Issue-ID: SO-1913
Signed-off-by: MariosIakovidis <marios.iakovidis@huawei.com>
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn

index 261f107..f06d71c 100644 (file)
@@ -38,18 +38,26 @@ public class HandlePNF extends AbstractServiceTaskProcessor{
     @Override
     void preProcessRequest(DelegateExecution execution) {
         logger.debug("Start preProcess for HandlePNF")
-
         // set correlation ID
         def resourceInput = execution.getVariable("resourceInput")
         String serInput = jsonUtil.getJsonValue(resourceInput, "requestsInputs")
         String correlationId = jsonUtil.getJsonValue(serInput, "service.parameters.requestInputs.ont_ont_pnf_name")
         if (!StringUtils.isEmpty(correlationId)) {
-            execution.setVariable(ExecutionVariableNames.CORRELATION_ID, correlationId)
+            execution.setVariable(ExecutionVariableNames.PNF_CORRELATION_ID, correlationId)
             logger.debug("Found correlation id : " + correlationId)
         } else {
             logger.error("== correlation id is empty ==")
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "correlation id is not provided")
         }
+        
+        String serviceInstanceID = jsonUtil.getJsonValue(resourceInput, ExecutionVariableNames.SERVICE_INSTANCE_ID)
+        if (!StringUtils.isEmpty(serviceInstanceID)) {
+            execution.setVariable(ExecutionVariableNames.SERVICE_INSTANCE_ID, serviceInstanceID)
+            logger.debug("found serviceInstanceID: "+serviceInstanceID)
+        } else {
+            logger.error("== serviceInstance ID is empty ==")
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "serviceInstance ID is not provided")
+        }
 
         // next task will set the uuid
         logger.debug("exit preProcess for HandlePNF")
index c81b289..01ca152 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
   <bpmn:process id="HandlePNF" name="HandlePNF" isExecutable="true">
     <bpmn:startEvent id="createNS_StartEvent_pnf_disc" name="start PNF handling">
       <bpmn:outgoing>SequenceFlow_1c92ks3_activate</bpmn:outgoing>
@@ -21,8 +21,9 @@ handlePNF.preProcessRequest(execution)</bpmn:script>
     <bpmn:sequenceFlow id="SequenceFlow_1la8oih" sourceRef="PostProcessPNFDiscovery" targetRef="Task_1r8h7of" />
     <bpmn:callActivity id="Task_0657l04" name="invoke pnf handler" calledElement="CreateAndActivatePnfResource">
       <bpmn:extensionElements>
-        <camunda:in source="correlationId" target="correlationId" />
+        <camunda:in source="pnfCorrelationId" target="pnfCorrelationId" />
         <camunda:in source="pnfUuid" target="pnfUuid" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_1apj1fn</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0pujwl4</bpmn:outgoing>