From: guanwenyao Date: Tue, 29 May 2018 10:04:08 +0000 (+0800) Subject: fix query ns scale endless loop X-Git-Tag: v1.2.1~22 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F49335%2F1;p=so.git fix query ns scale endless loop Issue-ID: SO-634 Change-Id: I79ac70be79345c966642dc5b99c25b4a39dc575d Signed-off-by: guanwenyao --- 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 0e4aea00ae..321741b721 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 @@ -95,12 +95,11 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess * scale NS task */ public void scaleNetworkService(DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") String saleNsRequest = execution.getVariable("reqBody") String[] nsReqStr = saleNsRequest.split("\\|") - def jobIdArray = ['jobId001', 'jobId002'] as String[] - for (int i = 0; i < nsReqStr.length; i++) { JSONObject reqBodyJsonObj = new JSONObject(nsReqStr[i]) String nsInstanceId = reqBodyJsonObj.getJSONObject("nsScaleParameters").getString("nsInstanceId") @@ -114,11 +113,11 @@ public class DoScaleVFCNetworkServiceInstance extends AbstractServiceTaskProcess String returnCode = apiResponse.getStatusCode() String aaiResponseAsString = apiResponse.getResponseBodyAsString() String jobId = ""; - if (returnCode == "200") { + if (returnCode == "200" || returnCode == "202") { jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId") } - - execution.setVariable("jobId", jobIdArray[i]) + utils.log("INFO", "scaleNetworkService get a ns scale job Id:" + jobId, isDebugEnabled) + execution.setVariable("jobId", jobId) String isScaleFinished = ""