* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
-import org.onap.so.logger.MsoLogger
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
/**
* This groovy class supports the <class>ActivateSDNCCNetworkResource.bpmn</class> process.
* flow for SDNC Network Resource Activate
*/
public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ActivateSDNCNetworkResource.class);
+ private static final Logger logger = LoggerFactory.getLogger( ActivateSDNCNetworkResource.class);
String Prefix = "ACTSDNCRES_"
MsoUtils msoUtils = new MsoUtils()
public void preProcessRequest(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- msoLogger.info(" ***** Started preProcessRequest *****")
+ logger.info(" ***** Started preProcessRequest *****")
try {
//get bpmn inputs from resource request.
String resourceInput = execution.getVariable("resourceInput")
//Get ResourceInput Object
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
- execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+ execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString())
//Deal with recipeParams
String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
- msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.debug( msg)
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
public void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) {
- msoLogger.info("started prepareUpdateAfterActivateSDNCResource ")
+ logger.info("started prepareUpdateAfterActivateSDNCResource ")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
String operType = resourceInputObj.getOperationType()
}
public void prepareSDNCRequest (DelegateExecution execution) {
- msoLogger.info("Started prepareSDNCRequest ")
+ logger.info("Started prepareSDNCRequest ")
try {
// get variables
} catch (Exception ex) {
String exceptionMessage = " Bpmn error encountered in CreateSDNCCNetworkResource flow. prepareSDNCRequest() - " + ex.getMessage()
- msoLogger.debug( exceptionMessage)
+ logger.debug(exceptionMessage)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.info(" ***** Exit prepareSDNCRequest *****")
+ logger.info(" ***** Exit prepareSDNCRequest *****")
}
public void postActivateSDNCCall(DelegateExecution execution) {
- msoLogger.info("started postCreateSDNCCall ")
+ logger.info("started postCreateSDNCCall ")
String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
- msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
+ logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
}
public void sendSyncResponse(DelegateExecution execution) {
- msoLogger.dubug(" *** sendSyncResponse *** ")
+ logger.info("started sendsyncResp")
try {
String operationStatus = "finished"
// RESTResponse for main flow
String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim()
- msoLogger.dubug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
+ logger.debug(" sendSyncResponse to APIH:" + "\n" + resourceOperationResp)
sendWorkflowResponse(execution, 202, resourceOperationResp)
execution.setVariable("sentSyncResponse", true)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse:" + ex.getMessage()
- msoLogger.debug( msg)
+ logger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.dubug(" ***** Exit sendSyncResponse *****")
+ logger.info("exited send sync Resp")
}
-}
\ No newline at end of file
+}