Merge "Update ConfigScaleOut payload format"
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy
index df6b27f..1b5a2ec 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/OofHoming.groovy
@@ -266,6 +266,8 @@
                             if (flavorsArrayList != null && flavorsArrayList.size != 0) {
                                 resource.getHomingSolution().setFlavors(flavorsArrayList)
                                 execution.setVariable(cloudRegionId + "_flavorList", flavorsArrayList)
+                                utils.log("DEBUG", "***** _flavorList is: " + flavorsArrayList.toString() +
+                                        " *****", "true")
                             }
 
                             if (inventoryType.equalsIgnoreCase("service")) {
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 9cdbdfd..ab84168 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
@@ -105,7 +105,10 @@
         List<NetworkResource> networkResourceList = new ArrayList<NetworkResource>()
 
         List<Resource> sequencedResourceList = new ArrayList<Resource>()
-        def resourceSequence = BPMNProperties.getResourceSequenceProp()
+        
+        String serviceDecompose = execution.getVariable("serviceDecomposition")
+        String serviceModelName = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelName")
+        def resourceSequence = BPMNProperties.getResourceSequenceProp(serviceModelName)
 
         if(resourceSequence != null) {
             // sequence is defined in config file
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
index 321741b..c1ffc5a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy
@@ -103,6 +103,7 @@
         for (int i = 0; i < nsReqStr.length; i++) {
             JSONObject reqBodyJsonObj = new JSONObject(nsReqStr[i])
             String nsInstanceId = reqBodyJsonObj.getJSONObject("nsScaleParameters").getString("nsInstanceId")
+            String nodeTemplateUUID = reqBodyJsonObj.getJSONObject("nsOperationKey").getString("nodeTemplateUUID")
             reqBodyJsonObj.getJSONObject("nsScaleParameters").remove("nsInstanceId")
             String reqBody = reqBodyJsonObj.toString()
 
@@ -112,15 +113,19 @@
 
             String returnCode = apiResponse.getStatusCode()
             String aaiResponseAsString = apiResponse.getResponseBodyAsString()
-            String jobId = "";
+            String jobId = ""
             if (returnCode == "200" || returnCode == "202") {
                 jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
             }
             utils.log("INFO", "scaleNetworkService get a ns scale job Id:" + jobId, isDebugEnabled)
             execution.setVariable("jobId", jobId)
+            execution.setVariable("nodeTemplateUUID", nodeTemplateUUID)
 
             String isScaleFinished = ""
 
+            if(jobId =="" || jobId == null){
+                continue
+            }
             // query the requested network service scale status, if finished, then start the next one, otherwise, wait
             while (isScaleFinished != "finished" && isScaleFinished != "error"){
                 timeDelay()
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
index 58f644d..4eca37b 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
@@ -125,9 +125,7 @@
             String operationId = execution.getVariable("operationId")
             String serviceInstanceId = execution.getVariable("serviceInstanceId")
             // RESTResponse for API Handler (APIH) Reply Task
-            String scaleServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${
-                operationId
-            }"}}""".trim()
+            String scaleServiceRestRequest = """{"operationId":"${operationId}"}""".trim()
             utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + scaleServiceRestRequest, isDebugEnabled)
             sendWorkflowResponse(execution, 202, scaleServiceRestRequest)
             execution.setVariable("sentSyncResponse", true)
@@ -256,7 +254,7 @@
         utils.log("INFO", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
         try{
             String serviceId = execution.getVariable("serviceInstanceId")
-            String serviceName = execution.getVariable("serviceInstanceName")
+            //String serviceName = execution.getVariable("serviceInstanceName")
             String operationId = execution.getVariable("operationId")
             String operationType = "SCALE"
             String userId = ""
@@ -280,7 +278,6 @@
                             <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">
                             <serviceId>${serviceId}</serviceId>
                             <operationId>${operationId}</operationId>
-                            <serviceName>${serviceName}</serviceName>
                             <operationType>${operationType}</operationType>
                             <userId>${userId}</userId>
                             <result>${result}</result>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java
index dbb552c..64d8530 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java
@@ -47,8 +47,8 @@
         return value;
     }
 
-    public static List<String> getResourceSequenceProp() {
-        String resourceSequence = getProperty("mso.workflow.custom.VolTE.resource.sequence", null);
+    public static List<String> getResourceSequenceProp(String input) {
+        String resourceSequence = getProperty("mso.workflow.custom." + input + ".resource.sequence", null);
         if (resourceSequence != null) {
             return Arrays.asList(resourceSequence.split(","));
         }
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
index 0a0c95a..876f91f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn
@@ -516,6 +516,7 @@
         <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
         <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
         <camunda:in source="serviceDecomposition" target="serviceDecomposition" />
+        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_0ws7fjn</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1mkdhw9</bpmn2:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
index 675b8fa..8cbc7e9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVnfAndModules.bpmn
@@ -40,6 +40,7 @@
         <camunda:in source="tenantId" target="tenantId" />
         <camunda:in source="false" target="usePreload" />
         <camunda:in source="aLaCarte" target="aLaCarte" />
+        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_1hf7k7q</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1ixcnb6</bpmn:outgoing>
@@ -127,6 +128,7 @@
         <camunda:in source="tenantId" target="tenantId" />
         <camunda:in source="rollbackData" target="rollbackData" />
         <camunda:in source="vnfResourceDecomposition" target="vnfResourceDecomposition" />
+        <camunda:in source="RegionOne_flavorList" target="RegionOne_flavorList" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_19ohb1a</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_07u8e3l</bpmn:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy
index e7ffe05..063f4b5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy
@@ -89,7 +89,6 @@
                             <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">
                             <serviceId>56c881ad-6c9d-4b79-aacc-401e5640b47f</serviceId>
                             <operationId>0a5b1651-c56e-4263-8c26-c8f8a6ef72d8</operationId>
-                            <serviceName>XXXX</serviceName>
                             <operationType>SCALE</operationType>
                             <userId></userId>
                             <result>processing</result>
@@ -163,7 +162,7 @@
         ExecutionEntity mockExecution = mock(ExecutionEntity.class)
 
         when(mockExecution.getVariable("serviceInstanceId")).thenReturn("56c881ad-6c9d-4b79-aacc-401e5640b47f")
-        when(mockExecution.getVariable("serviceInstanceName")).thenReturn("XXXX")
+        //when(mockExecution.getVariable("serviceInstanceName")).thenReturn("XXXX")
         when(mockExecution.getVariable("operationId")).thenReturn("0a5b1651-c56e-4263-8c26-c8f8a6ef72d8")
 
         ScaleCustomE2EServiceInstance scaleCustomE2EServiceInstance = new ScaleCustomE2EServiceInstance()
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index f05f9ce..50bed2c 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -11,7 +11,7 @@
 Version: 1.2.2
 --------------
 
-:Release Date: 2018-05-24
+:Release Date: 2018-06-07
 
 The Beijing release is the second release of the Service Orchestrator (SO) project.
 
@@ -29,15 +29,22 @@
 The defects fixed in this release could be found `here<https://jira.onap.org/issues/?jql=project%20%3D%20SO%20AND%20affectedVersion%20%3D%20%22Beijing%20Release%22%20AND%20status%20%3D%20Closed%20>`_.
 
 **Known Issues**
- 
-**Security Issues**
-SO CII Badging details can be found `here<https://bestpractices.coreinfrastructure.org/en/projects/1702>`_. 
-The remaining security issues and their workarounds are captured `here <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_.
+	NA
+
+**Security Notes**
+
+SO code has been formally scanned during build time using NexusIQ and all Critical vulnerabilities have been addressed, items that remain open have been assessed for risk and determined to be false positive. The SO open Critical security vulnerabilities and their risk assessment have been documented as part of the `project <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_.
+
+Quick Links:
+- `SO project page <https://wiki.onap.org/display/DW/Service+Orchestrator+Project>`_
+- `Passing Badge information for SO <https://bestpractices.coreinfrastructure.org/en/projects/1702>`_
+- `Project Vulnerability Review Table for SO <https://wiki.onap.org/pages/viewpage.action?pageId=28377799>`_
 
 **Upgrade Notes**
+	NA
 
 **Deprecation Notes**
-
+	NA
 
 Version: 1.1.2
 --------------
@@ -93,6 +100,7 @@
 - mso/mso-config
 	
 **Other**
+	NA
 
 ===========