def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
logDebug('Entered ' + method, isDebugLogEnabled)
+ execution.setVariable("CVFMI_sentSyncResponse", false)
+
def prefix = 'CVFMI_'
logDebug('Entered 1' + method, isDebugLogEnabled)
execution.setVariable('prefix', prefix)
utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)
utils.logAudit("CreateVfModule Infra incoming Request: " + incomingRequest)
+ setBasicDBAuthHeader(execution, isDebugLogEnabled)
+
// check if request is xml or json
try {
def jsonSlurper = new JsonSlurper()
}
}
- execution.setVariable(prefix + 'disableRollback', suppressRollback)
+ execution.setVariable('disableRollback', suppressRollback)
def vfModuleName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
execution.setVariable(prefix + 'vfModuleName', vfModuleName)
execution.setVariable("CVFMI_requestInfo", requestInfo)
//backoutOnFailure
-
- //NetworkUtils networkUtils = new NetworkUtils()
- //execution.setVariable("CVFMI_rollbackEnabled", networkUtils.isRollbackEnabled(execution,request))
+
execution.setVariable("CVFMI_originalWorkflowException", null)
sendWorkflowResponse(execution, 200, synchResponse)
+ execution.setVariable("CVFMI_sentSyncResponse", true)
utils.logAudit("CreateVfModule Infra Response: " + synchResponse)
logDebug('Exited ' + method, isDebugLogEnabled)
} catch (BpmnError e) {
utils.log("DEBUG", "requestInfo is: " + requestInfo, isDebugEnabled)
utils.log("DEBUG", "action is: " + action, isDebugEnabled)
- try {\r
- String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth")\r
- utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugEnabled)\r
- \r
- def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey"))\r
- execution.setVariable("BasicAuthHeaderValueDB",encodedString)\r
- } catch (IOException ex) {\r
- String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage()\r
- utils.log("DEBUG", dataErrorMessage, isDebugEnabled)\r
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)\r
- }\r
- \r
String payload =
""" <aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
xmlns:ns="http://org.openecomp/mso/request/types/v1"
// vfModuleName may be generated by DoCreateVfModule subprocess if it is not specified on the input
def vfModuleName = execution.getVariable("CVFMI_vfModuleName")
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_db_endpoint")
+ def dbAdapterEndpoint = execution.getVariable("URN_mso_openecomp_adapters_db_endpoint")
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
- try {\r
- String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth")\r
- utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugEnabled)\r
- \r
- def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey"))\r
- execution.setVariable("BasicAuthHeaderValueDB",encodedString)\r
- } catch (IOException ex) {\r
- String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage()\r
- utils.log("DEBUG", dataErrorMessage, isDebugEnabled)\r
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage)\r
- }\r
- \r
String payload =
"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://org.openecomp.mso/requestsdb">
}
-
+ public void sendErrorResponse(Execution execution){
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ utils.log("DEBUG", " *** STARTED CreateVfModulenfra sendErrorResponse Process *** ", isDebugEnabled)
+ try {
+ def sentSyncResponse = execution.getVariable("CVFMI_sentSyncResponse")
+ if(sentSyncResponse == false){
+ WorkflowException wfex = execution.getVariable("WorkflowException")
+ String response = exceptionUtil.buildErrorResponseXml(wfex)
+
+ utils.logAudit(response)
+ sendWorkflowResponse(execution, 500, response)
+ }else{
+ utils.log("DEBUG", "Not Sending Error Response. Sync Response Already Sent", isDebugEnabled)
+ }
+
+ } catch (Exception ex) {
+ utils.log("DEBUG", "Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage(), isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVfModuleInfra sendErrorResponse Process")
+
+ }
+ utils.log("DEBUG", "*** COMPLETED CreateVfModuleInfra sendErrorResponse Process ***", isDebugEnabled)
+ }
}