* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 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.core.WorkflowException
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
import org.springframework.web.util.UriUtils;
import groovy.json.*
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DeleteCustomE2EServiceInstance.class);
+ private static final Logger logger = LoggerFactory.getLogger( DeleteCustomE2EServiceInstance.class);
public void preProcessRequest (DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
String msg = ""
- msoLogger.info("Starting preProcessRequest")
+ logger.info("Starting preProcessRequest")
try {
// check for incoming json message/input
String siRequest = execution.getVariable("bpmnRequest")
- msoLogger.debug(siRequest)
+ logger.debug(siRequest)
String requestId = execution.getVariable("mso-request-id")
execution.setVariable("msoRequestId", requestId)
- msoLogger.info("Input Request:" + siRequest + " reqId:" + requestId)
+ logger.info("Input Request:" + siRequest + " reqId:" + requestId)
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
// if (isBlank(productFamilyId))
// {
// msg = "Input productFamilyId is null"
-// utils.log("INFO", msg, isDebugEnabled)
+// logger.info( msg)
// //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
// } else {
// execution.setVariable("productFamilyId", productFamilyId)
String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
- msoLogger.info(msg)
+ logger.info(msg)
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "serviceType")
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
- msoLogger.debug(msg)
+ logger.debug(msg)
//exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit preProcessRequest")
+ logger.trace("Exit preProcessRequest")
}
public void sendSyncResponse (DelegateExecution execution) {
- msoLogger.trace("Staring sendSyncResponse")
+ logger.trace("Staring sendSyncResponse")
try {
String operationId = execution.getVariable("operationId")
String syncResponse = """{"operationId":"${operationId}"}""".trim()
- msoLogger.info("sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
+ logger.info("sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse: " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
- msoLogger.trace("Exit sendSyncResopnse")
+ logger.trace("Exit sendSyncResopnse")
}
public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.info("Starting sendSyncError")
+ logger.info("Starting sendSyncError")
try {
String errorMessage = ""
<aetgt:ErrorCode>7000</aetgt:ErrorCode>
</aetgt:WorkflowException>"""
- msoLogger.info(buildworkflowException)
+ logger.info(buildworkflowException)
sendWorkflowResponse(execution, 500, buildworkflowException)
} catch (Exception ex) {
- msoLogger.info("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
+ logger.info("Sending Sync Error Activity Failed. " + "\n" + ex.getMessage())
}
}
public void prepareCompletionRequest (DelegateExecution execution) {
- msoLogger.trace("Starting prepareCompletion")
+ logger.trace("Starting prepareCompletion")
try {
String requestId = execution.getVariable("msoRequestId")
String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- msoLogger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
+ logger.info(" Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest)
} catch (Exception ex) {
String msg = " Exception in prepareCompletion:" + ex.getMessage()
- msoLogger.info(msg)
+ logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- msoLogger.trace("Exit prepareCompletionRequest")
+ logger.trace("Exit prepareCompletionRequest")
}
public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- msoLogger.trace("Starting prepareFalloutRequest ")
+ logger.trace("Starting prepareFalloutRequest ")
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
- msoLogger.info(" Input Workflow Exception: " + wfex.toString())
+ logger.info(" Input Workflow Exception: " + wfex.toString())
String requestId = execution.getVariable("msoRequestId")
String source = execution.getVariable("source")
String requestInfo =
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
execution.setVariable("falloutRequest", falloutRequest)
} catch (Exception ex) {
- msoLogger.info("Exception prepareFalloutRequest:" + ex.getMessage())
+ logger.info("Exception prepareFalloutRequest:" + ex.getMessage())
String errorException = " Bpmn error encountered in CreateServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
String requestId = execution.getVariable("msoRequestId")
String falloutRequest =
execution.setVariable("falloutRequest", falloutRequest)
}
- msoLogger.trace("Exit prepareFalloutRequest")
+ logger.trace("Exit prepareFalloutRequest")
}
execution.setVariable("prefix", Prefix)
try {
- msoLogger.info("Starting prepareDBRequest")
+ logger.info("Starting prepareDBRequest")
String requestId = execution.getVariable("DELSI_requestId")
String statusMessage = "E2E Service Instance successfully deleted."
String buildDeleteDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBRequest", buildDeleteDBRequestAsString)
- msoLogger.info(buildDeleteDBRequestAsString)
+ logger.info(buildDeleteDBRequestAsString)
} catch (Exception ex) {
// try error in method block
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
- msoLogger.trace("Start prepareDBRequestError")
+ logger.trace("Start prepareDBRequestError")
try {
String requestId = execution.getVariable("DELSI_requestId")
String buildDBRequestAsString = utils.formatXml(dbRequest)
execution.setVariable("DELSI_createDBInfraErrorRequest", buildDBRequestAsString)
- msoLogger.info(buildDBRequestAsString)
+ logger.info(buildDBRequestAsString)
} catch (Exception ex) {
// try error in method block
* Init the service Operation Status
*/
public void prepareInitServiceOperationStatus(DelegateExecution execution){
- msoLogger.debug("======== STARTED prepareInitServiceOperationStatus Process ======== ")
+ logger.debug("======== STARTED prepareInitServiceOperationStatus Process ======== ")
try{
String serviceId = execution.getVariable("serviceInstanceId")
String operationId = execution.getVariable("operationId")
String progress = "0"
String reason = ""
String operationContent = "Prepare service creation"
- msoLogger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
+ logger.debug("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId)
serviceId = UriUtils.encode(serviceId,"UTF-8")
def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- msoLogger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
+ logger.debug("DB Adapter Endpoint is: " + dbAdapterEndpoint)
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
payload = utils.formatXml(payload)
execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- msoLogger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
+ logger.debug("Outgoing updateServiceOperStatusRequest: \n" + payload)
}catch(Exception e){
- msoLogger.error("Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
+ logger.error("Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e)
execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
}
- msoLogger.debug("======== COMPLETED prepareInitServiceOperationStatus Process ======== ")
+ logger.debug("======== COMPLETED prepareInitServiceOperationStatus Process ======== ")
}
}