From 8e6c5e5baf5ae2f68b8f6f86b35f8fe3d64edb86 Mon Sep 17 00:00:00 2001 From: hetengjiao Date: Tue, 12 May 2020 09:32:32 +0800 Subject: Change CheckServiceProcessStatus Closure to function to fix out of memory problem Issue-ID: SO-2917 Change-Id: Ie6e769ac56312fd216f462fdce5d5c1eb632da0a Signed-off-by: hetengjiao --- .../scripts/CheckServiceProcessStatus.groovy | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CheckServiceProcessStatus.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CheckServiceProcessStatus.groovy index 169c00b68b..ecbe766695 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CheckServiceProcessStatus.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CheckServiceProcessStatus.groovy @@ -129,7 +129,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { /** * check service status through request operation id, update operation status */ - def preCheckServiceStatusReq = { DelegateExecution execution -> + void preCheckServiceStatusReq(DelegateExecution execution) { logger.trace(Prefix + "preCheckServiceStatusReq Start") String serviceInstanceId = execution.getVariable("serviceInstanceId") as String String operationId = execution.getVariable("operationId") as String @@ -142,7 +142,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { * handle service status, if service status is finished or error, set the service status * @param execution */ - def handlerServiceStatusResp = { DelegateExecution execution -> + void handlerServiceStatusResp(DelegateExecution execution) { logger.trace(Prefix + "handlerServiceStatusResp Start") String msg try { @@ -203,7 +203,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - def timeWaitDelay = { DelegateExecution execution -> + void timeWaitDelay(DelegateExecution execution) { Long startTime = execution.getVariable("startTime") as Long Long timeOut = execution.getVariable("timeOut") as Long @@ -221,7 +221,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - private handlerTimeOut = { DelegateExecution execution -> + private handlerTimeOut(DelegateExecution execution) { Map paramMap = execution.getVariable("timeOutParamMap") as Map @@ -229,7 +229,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - private handlerSuccess = { DelegateExecution execution, String result -> + private handlerSuccess(DelegateExecution execution, String result) { Map paramMap = execution.getVariable("successParamMap") as Map @@ -237,7 +237,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - private handlerError = { DelegateExecution execution, String result -> + private handlerError(DelegateExecution execution, String result) { Map paramMap = execution.getVariable("errorParamMap") as Map @@ -245,7 +245,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - private handlerProcess = { DelegateExecution execution, String result, def paramMap, def status, def msg -> + private handlerProcess(DelegateExecution execution, String result, def paramMap, def status, def msg) { if (paramMap != null) { for (Map.Entry entry : paramMap.entrySet()) { @@ -260,7 +260,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { if (isBlank(execution.getVariable("operationContent") as String)) { - String operationContent = execution.getVariable("processServiceType") + " " + + String operationContent = execution.getVariable("processServiceType") + " " + execution.getVariable("operationType") + " operation finished " + msg execution.setVariable("operationContent", operationContent) } @@ -275,7 +275,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { /** * judge if the service processing success finished */ - private isSuccessCompleted = { DelegateExecution execution, String result -> + private Boolean isSuccessCompleted(DelegateExecution execution, String result) { //successConditions: processing end success conditions List successConditions = execution.getVariable("successConditions") as List @@ -291,7 +291,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { /** * judge if the service processing error finished */ - private isErrorCompleted = { DelegateExecution execution, String result -> + private Boolean isErrorCompleted(DelegateExecution execution, String result) { //errorConditions: processing end error conditions List errorConditions = execution.getVariable("errorConditions") as List @@ -304,7 +304,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { } - def preUpdateOperationProgress = { DelegateExecution execution -> + void preUpdateOperationProgress(DelegateExecution execution) { logger.trace(Prefix + "prepareUpdateOperationStatus Start") def progress = execution.getVariable("progress") as Integer @@ -314,7 +314,7 @@ class CheckServiceProcessStatus extends AbstractServiceTaskProcessor { def resProgress = (initProgress + (endProgress - initProgress) / 100 * progress) as Integer def operationType = execution.getVariable("operationType") - def operationContent = execution.getVariable("processServiceType") + " " + + def operationContent = execution.getVariable("processServiceType") + " " + operationType + " operation processing " + resProgress // update status creating -- cgit 1.2.3-korg