From 60ea8dec7591def51cb986992ceee542e1f078e0 Mon Sep 17 00:00:00 2001 From: guanwenyao Date: Tue, 29 May 2018 18:04:08 +0800 Subject: fix query ns scale endless loop Issue-ID: SO-634 Change-Id: I79ac70be79345c966642dc5b99c25b4a39dc575d Signed-off-by: guanwenyao --- .../scripts/DoScaleVFCNetworkServiceInstance.groovy | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp') 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 = "" -- cgit 1.2.3-korg