*/\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.RollbackData\r
import org.openecomp.mso.bpmn.core.WorkflowException\r
import org.openecomp.mso.rest.APIResponse\r
\r
def Prefix="CAAIVfMod_"\r
ExceptionUtil exceptionUtil = new ExceptionUtil()\r
- public void initProcessVariables(Execution execution) {\r
+ public void initProcessVariables(DelegateExecution execution) {\r
execution.setVariable("prefix",Prefix)\r
execution.setVariable("CAAIVfMod_vnfId",null)\r
execution.setVariable("CAAIVfMod_vnfName",null)\r
} \r
\r
// parse the incoming CREATE_VF_MODULE request and store the Generic VNF\r
- // and VF Module data in the flow Execution\r
- public void preProcessRequest(Execution execution) {\r
+ // and VF Module data in the flow DelegateExecution\r
+ public void preProcessRequest(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
initProcessVariables(execution)\r
\r
\r
// send a GET request to AA&I to retrieve the Generic VNF/VF Module information based on a Vnf Name\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 endPoint = execution.getVariable("URN_aai_endpoint") + execution.getVariable("CAAIVfMod_genericVnfGetEndpoint")\r
\r
\r
// process the result from queryAAIForGenericVnf()\r
// note: this method is primarily for logging as the actual decision logic is embedded in the bpmn flow \r
- public void processAAIGenericVnfQuery(Execution execution) {\r
+ public void processAAIGenericVnfQuery(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def result = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
\r
\r
// construct and send a PUT request to A&AI to create a new Generic VNF\r
// note: to get here, the vnf-id in the original CREATE_VF_MODULE request was absent or ""\r
- public void createGenericVnf(Execution execution) {\r
+ public void createGenericVnf(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
// TBD - is this how we want to generate the Id for the new Generic VNF?\r
def newVnfId = UUID.randomUUID().toString()\r
}\r
\r
// construct and send a PUT request to A&AI to create a Base or Add-on VF Module\r
- public void createVfModule(Execution execution, Boolean isBaseModule) {\r
+ public void createVfModule(DelegateExecution execution, Boolean isBaseModule) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
// TBD - is this how we want to generate the Id for the new (Base) VF Module?\r
\r
// parses the output from the result from queryAAIForGenericVnf() to determine if the vf-module-name\r
// requested for an Add-on VF Module does not already exist for the specified Generic VNF\r
// also retrieves VNF name from AAI response for existing VNF\r
- public void parseForAddOnModule(Execution execution) {\r
+ public void parseForAddOnModule(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def xml = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
def vnfNameFromAAI = utils.getNodeText1(xml, "vnf-name")\r
// parses the output from the result from queryAAIForGenericVnf() to determine if the vf-module-name\r
// requested for an Add-on VF Module does not already exist for the specified Generic VNF; \r
// also retrieves VNF name from AAI response for existing VNF\r
- public void parseForBaseModule(Execution execution) {\r
+ public void parseForBaseModule(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
def xml = execution.getVariable("CAAIVfMod_queryGenericVnfResponse")\r
def vnfNameFromAAI = utils.getNodeText1(xml, "vnf-name")\r
}\r
\r
// generates a WorkflowException when the A&AI query returns a response code other than 200 or 404\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 requested Generic VNF does not exist but vnf-id != null\r
// - the A&AI VF Module PUT returns a response code other than 200 or 201\r
// - the requested VF Module already exists for the Generic VNF\r
- public void handleCreateVfModuleFailure(Execution execution) {\r
+ public void handleCreateVfModuleFailure(DelegateExecution execution) {\r
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
\r
def errorCode\r
* main CreateVfModule flow.\r
* @param execution the execution\r
*/\r
- public void rollback(Execution execution) {\r
+ public void rollback(DelegateExecution execution) {\r
def method = getClass().getSimpleName() + ".rollback(" +\r
"execution=" + execution.getId() +\r
")"\r