Fix SDNC request structure

Fix SDNC requst structure for e2e service.

Following is current body for request:

{
	"GENERIC-RESOURCE-API:input": {
		"GENERIC-RESOURCE-API:sdnc-request-header": {
			"GENERIC-RESOURCE-API:svc-request-id": "7b1e36ae-6691-4676-993b-4d173bad45cd",
			"GENERIC-RESOURCE-API:svc-action": "assign"
		},
		"GENERIC-RESOURCE-API:request-information": {
			"GENERIC-RESOURCE-API:request-id": "7b1e36ae-6691-4676-993b-4d173bad45cd",
			"GENERIC-RESOURCE-API:request-action": "CreateServiceInstance"
		},
		"GENERIC-RESOURCE-API:service-information": {
			"GENERIC-RESOURCE-API:service-id": "VOLTE_SERVICE_ID",
			"GENERIC-RESOURCE-API:subscription-service-type": "example-service-type",
			"GENERIC-RESOURCE-API:onap-model-information": {
				"GENERIC-RESOURCE-API:model-invariant-uuid": "4a09419a-c9fd-4a53-b1bd-b49603169ca1",
				"GENERIC-RESOURCE-API:model-uuid": "1bd0eae6-2dcc-4461-9ae6-56d641f369d6",
				"GENERIC-RESOURCE-API:model-name": "voLTE_HUAWEI_01:null"
			},
			"GENERIC-RESOURCE-API:service-instance-id": "1ff52068-6622-440c-964f-5774d91a956a",
			"GENERIC-RESOURCE-API:global-customer-id": "test_custormer"
		},
		"GENERIC-RESOURCE-API:service-request-input": {
			"GENERIC-RESOURCE-API:service-instance-name": "ONAP_223531"
		}
	}
}

Change-Id: I5098f3f8e11e0e1dad30b53fbf1db13aeac87f78
Issue-ID: SO-422
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 7ccc1b0..6f41879 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -20,6 +20,7 @@
  
 package org.openecomp.mso.bpmn.infrastructure.scripts
 
+import org.codehaus.jackson.map.ObjectMapper
 import org.openecomp.mso.bpmn.infrastructure.properties.BPMNProperties
 
 import java.util.ArrayList
@@ -146,7 +147,28 @@
         execution.setVariable("sequencedResourceList", sequencedResourceList)
         utils.log("INFO", "sequencedResourceList: " + sequencedResourceList, isDebugEnabled) 
         utils.log("INFO", "======== COMPLETED sequenceResoure Process ======== ", isDebugEnabled)
-    }   
+    }
+
+    public prepareServiceTopologyRequest(DelegateExecution execution) {
+
+        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+        utils.log("INFO", "======== Start prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+
+        String serviceDecompose = execution.getVariable("serviceDecomposition")
+
+        execution.setVariable("operationType", "create")
+        execution.setVariable("resourceType", "")
+
+        String serviceInvariantUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelInvariantUuid")
+        String serviceUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelUuid")
+        String serviceModelName = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelName")
+
+        execution.setVariable("modelInvariantUuid", serviceInvariantUuid)
+        execution.setVariable("modelUuid", serviceUuid)
+        execution.setVariable("serviceModelName", serviceModelName)
+
+        utils.log("INFO", "======== End prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+    }
    
     public void getCurrentResoure(DelegateExecution execution){
 	    def isDebugEnabled=execution.getVariable("isDebugLogEnabled")   
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
index 9ed1431..5bb3d31 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
@@ -20,7 +20,7 @@
 csi.postConfigRequest(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:serviceTask id="Task_0io5qby" name="Call Sync SDNC service Create " camunda:class="org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.SdncServiceTopologyOperationTask">
-      <bpmn2:incoming>SequenceFlow_1vprtt9</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_0k0f7lm</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_11f2zuu</bpmn2:outgoing>
     </bpmn2:serviceTask>
     <bpmn2:sequenceFlow id="SequenceFlow_11f2zuu" sourceRef="Task_0io5qby" targetRef="IntermediateThrowEvent_0f2w7aj" />
@@ -85,7 +85,7 @@
       <bpmn2:incoming>SequenceFlow_11f2zuu</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="ResourceLoop" />
     </bpmn2:intermediateThrowEvent>
-    <bpmn2:sequenceFlow id="SequenceFlow_1vprtt9" name="yes" sourceRef="ExclusiveGateway_07rr3wp" targetRef="Task_0io5qby">
+    <bpmn2:sequenceFlow id="SequenceFlow_1vprtt9" name="yes" sourceRef="ExclusiveGateway_07rr3wp" targetRef="Task_1blaq0f">
       <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{(execution.getVariable("isContainsWanResource" )  == "true" )}]]></bpmn2:conditionExpression>
     </bpmn2:sequenceFlow>
     <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_05dus9b" name="StartPrepareResource">
@@ -126,6 +126,14 @@
       <bpmn2:sequenceFlow id="SequenceFlow_0gr9xqj" name="" sourceRef="StartEvent_0x7o2ug" targetRef="ScriptTask_1648adp" />
       <bpmn2:sequenceFlow id="SequenceFlow_0a6l29p" name="" sourceRef="ScriptTask_1648adp" targetRef="EndEvent_0lgdyyb" />
     </bpmn2:subProcess>
+    <bpmn2:scriptTask id="Task_1blaq0f" name="Prepare SDNC service Create" scriptFormat="groovy">
+      <bpmn2:incoming>SequenceFlow_1vprtt9</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0k0f7lm</bpmn2:outgoing>
+      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def ddsi = new DoCreateResources()
+ddsi.prepareServiceTopologyRequest(execution)]]></bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_0k0f7lm" sourceRef="Task_1blaq0f" targetRef="Task_0io5qby" />
   </bpmn2:process>
   <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -144,15 +152,15 @@
         <dc:Bounds x="1119" y="485" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0qi8cgg_di" bpmnElement="Task_0io5qby">
-        <dc:Bounds x="944" y="353" width="100" height="80" />
+        <dc:Bounds x="1047" y="353" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_11f2zuu_di" bpmnElement="SequenceFlow_11f2zuu">
-        <di:waypoint xsi:type="dc:Point" x="1044" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="1090" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="1090" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="1147" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="1219" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="1219" y="300" />
         <di:waypoint xsi:type="dc:Point" x="1315" y="300" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1060" y="340.5" width="90" height="12" />
+          <dc:Bounds x="1189" y="340.5" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1y0los4_di" bpmnElement="ScriptTask_1y0los4">
@@ -243,7 +251,7 @@
       <bpmndi:BPMNEdge id="SequenceFlow_1vprtt9_di" bpmnElement="SequenceFlow_1vprtt9">
         <di:waypoint xsi:type="dc:Point" x="778" y="325" />
         <di:waypoint xsi:type="dc:Point" x="778" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="944" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="861" y="394" />
         <bpmndi:BPMNLabel>
           <dc:Bounds x="784" y="353" width="20" height="12" />
         </bpmndi:BPMNLabel>
@@ -347,6 +355,16 @@
           <dc:Bounds x="567.5" y="888" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0dh2mj1_di" bpmnElement="Task_1blaq0f">
+        <dc:Bounds x="861" y="354" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0k0f7lm_di" bpmnElement="SequenceFlow_0k0f7lm">
+        <di:waypoint xsi:type="dc:Point" x="961" y="394" />
+        <di:waypoint xsi:type="dc:Point" x="1047" y="393" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1004" y="372.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>