aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorguanwenyao <guanwenyao@chinamobile.com>2018-05-31 19:55:11 +0800
committerguanwenyao <guanwenyao@chinamobile.com>2018-05-31 19:55:17 +0800
commit40f7a561568f6feb1bbc9370d71b4831fa5464ca (patch)
treea1b2dfed9895f933aa9162ee2826249d46561c99 /bpmn
parentd0e24a65c4f84bcd5322b02abd0e19eb1a4d7c78 (diff)
fix resource_operation_status table change
Issue-ID: SO-634 Change-Id: I2ddf86640d7d20808dbbe379949f61b9f8031769 Signed-off-by: guanwenyao <guanwenyao@chinamobile.com>
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoScaleVFCNetworkServiceInstance.groovy7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstanceTest.groovy3
3 files changed, 9 insertions, 8 deletions
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 321741b721..c1ffc5abef 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 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
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 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess
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 58f644d53f..4eca37b304 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 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
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 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
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 @@ public class ScaleCustomE2EServiceInstance extends AbstractServiceTaskProcessor
<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/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 e7ffe05424..063f4b571b 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 @@ class SacleCustomE2EServiceInstanceTest{
<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 @@ class SacleCustomE2EServiceInstanceTest{
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()