X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2Fso-bpmn-infrastructure-common%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Finfrastructure%2Fscripts%2FHandlePNF.groovy;h=97eb3b39602adf5fe57322d1b33e406db6aaebca;hb=73416d2bebe39643e30c91d0ce5a6f4d3f91ce62;hp=f06d71cec4e257116adc27b54f238760f754e4e1;hpb=560e84158798cb884de65e3cf33ab657f0e6e6df;p=so.git diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy index f06d71cec4..97eb3b3960 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2017 - 2019 Huawei Intellectual Property. All rights reserved. * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -22,18 +22,24 @@ package org.onap.so.bpmn.infrastructure.scripts import org.apache.commons.lang3.StringUtils import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.so.bpmn.common.recipe.ResourceInput +import org.onap.so.bpmn.common.resource.ResourceRequestBuilder import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.MsoUtils +import org.onap.so.bpmn.core.UrnPropertiesReader import org.onap.so.bpmn.core.json.JsonUtils import org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames import org.slf4j.Logger import org.slf4j.LoggerFactory public class HandlePNF extends AbstractServiceTaskProcessor{ - private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class); + private static final Logger logger = LoggerFactory.getLogger( HandlePNF.class) ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() + MsoUtils msoUtils = new MsoUtils() + String Prefix="CRESI_" @Override void preProcessRequest(DelegateExecution execution) { @@ -65,7 +71,33 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ void postProcessRequest(DelegateExecution execution) { logger.debug("start postProcess for HandlePNF") + ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable("resourceInput"), ResourceInput.class) + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String serviceInstanceId = resourceInputObj.getServiceInstanceId() + String operationId = resourceInputObj.getOperationId() + String progress = "100" + String status = "finished" + String statusDescription = "SDCN resource creation and activation completed" + String body = """ + + + + + ${msoUtils.xmlEscape(operType)} + ${msoUtils.xmlEscape(operationId)} + ${msoUtils.xmlEscape(progress)} + ${msoUtils.xmlEscape(resourceCustomizationUuid)} + ${msoUtils.xmlEscape(serviceInstanceId)} + ${msoUtils.xmlEscape(status)} + ${msoUtils.xmlEscape(statusDescription)} + + + """ + logger.debug("body: "+body) + setProgressUpdateVariables(execution, body) logger.debug("exit postProcess for HandlePNF") } @@ -87,4 +119,10 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ } logger.debug(" ***** Exit sendSyncResponse *****") } + + private void setProgressUpdateVariables(DelegateExecution execution, String body) { + def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution) + execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) + execution.setVariable("CVFMI_updateResOperStatusRequest", body) + } }