/*-\r
* ============LICENSE_START=======================================================\r
- * OPENECOMP - MSO\r
+ * ONAP - SO\r
* ================================================================================\r
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
* ================================================================================\r
*/\r
\r
package org.openecomp.mso.bpmn.common.scripts\r
-import org.camunda.bpm.engine.runtime.Execution\r
+import org.camunda.bpm.engine.delegate.DelegateExecution\r
import org.openecomp.mso.bpmn.core.WorkflowException\r
import org.openecomp.mso.rest.APIResponse\r
import org.openecomp.mso.rest.RESTClient;\r
def Prefix="DAAIVfMod_"\r
ExceptionUtil exceptionUtil = new ExceptionUtil()\r
private MsoUtils utils = new MsoUtils()\r
- public void initProcessVariables(Execution execution) {\r
+ public void initProcessVariables(DelegateExecution execution) {\r
execution.setVariable("prefix",Prefix)\r
execution.setVariable("DAAIVfMod_vnfId",null)\r
execution.setVariable("DAAIVfMod_vnfName",null)\r
}\r
\r
// parse the incoming DELETE_VF_MODULE request and store the Generic Vnf\r
- // and Vf Module Ids in the flow Execution\r
- public void preProcessRequest(Execution execution) {\r
+ // and Vf Module Ids in the flow DelegateExecution\r
+ public void preProcessRequest(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def xml = execution.getVariable("DeleteAAIVfModuleRequest")\r
utils.logAudit("DeleteAAIVfModule Request: " + xml)\r
\r
// send a GET request to AA&I to retrieve the Generic Vnf/Vf Module information based on a Vnf Id\r
// expect a 200 response with the information in the response body or a 404 if the Generic Vnf does not exist\r
- public void queryAAIForGenericVnf(Execution execution) {\r
+ public void queryAAIForGenericVnf(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def delModuleId = execution.getVariable("DAAIVfMod_vfModuleId")\r
def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_genericVnfEndpoint") + "?depth=1"\r
\r
// construct and send a DELETE request to A&AI to delete a Generic Vnf\r
// note: to get here, all the modules associated with the Generic Vnf must already be deleted\r
- public void deleteGenericVnf(Execution execution) {\r
+ public void deleteGenericVnf(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def aaiRequestId = utils.getRequestID()\r
def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_genericVnfEndpoint") +\r
}\r
\r
// construct and send a DELETE request to A&AI to delete the Base or Add-on Vf Module\r
- public void deleteVfModule(Execution execution) {\r
+ public void deleteVfModule(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("DAAIVfMod_vfModuleEndpoint") +\r
"/?resource-version=" + execution.getVariable("DAAIVfMod_vfModRsrcVer")\r
// parses the output from the result from queryAAIForGenericVnf() to determine if the Vf Module\r
// to be deleted exists for the specified Generic Vnf and if it is the Base Module,\r
// there are no Add-on Modules present\r
- public void parseForVfModule(Execution execution) {\r
+ public void parseForVfModule(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def xml = execution.getVariable("DAAIVfMod_queryGenericVnfResponse")\r
utils.logAudit("DeleteAAIVfModule - queryGenericVnfResponse" + xml)\r
// parses the output from the result from queryAAIForGenericVnf() to determine if the Vf Module\r
// to be deleted exists for the specified Generic Vnf and if it is the Base Module,\r
// there are no Add-on Modules present\r
- public void parseForResourceVersion(Execution execution) {\r
+ public void parseForResourceVersion(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def xml = execution.getVariable("DAAIVfMod_queryGenericVnfResponse")\r
utils.logAudit("DeleteAAIVfModule - queryGenericVnfResponse" + xml)\r
\r
\r
// generates a WorkflowException if the A&AI query returns a response code other than 200\r
- public void handleAAIQueryFailure(Execution execution) {\r
+ public void handleAAIQueryFailure(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
\r
utils.log("ERROR", "Error occurred attempting to query AAI, Response Code " +\r
// - the A&AI Vf Module DELETE returns a response code other than 200\r
// - the Vf Module is a Base Module that is not the last Vf Module\r
// - the Vf Module does not exist for the Generic Vnf\r
- public void handleDeleteVfModuleFailure(Execution execution) {\r
+ public void handleDeleteVfModuleFailure(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
\r
def errorCode = 2000\r
\r
// generates a WorkflowException if\r
// - the A&AI Generic Vnf DELETE returns a response code other than 200\r
- public void handleDeleteGenericVnfFailure(Execution execution) {\r
+ public void handleDeleteGenericVnfFailure(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
utils.log("ERROR", "AAI error occurred deleting the Generic Vnf: "\r
+ execution.getVariable("DAAIVfMod_deleteGenericVnfResponse"), isDebugEnabled)\r