diff options
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy index 36f2d9fa1f..829e4d9d4b 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy @@ -34,7 +34,7 @@ import org.openecomp.mso.rest.APIResponse import java.util.UUID; import org.camunda.bpm.engine.delegate.BpmnError -import org.camunda.bpm.engine.runtime.Execution +import org.camunda.bpm.engine.delegate.DelegateExecution import org.apache.commons.lang3.* import org.apache.commons.codec.binary.Base64; import org.springframework.web.util.UriUtils @@ -55,7 +55,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. * @param execution */ - public InitializeProcessVariables(Execution execution){ + public InitializeProcessVariables(DelegateExecution execution){ /* Initialize all the process variables in this block */ execution.setVariable(Prefix + "messageId", "") @@ -146,7 +146,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { * This method is executed during the preProcessRequest task of the <class>DoUpdateNetworkInstance.bpmn</class> process. * @param execution */ - public void preProcessRequest (Execution execution) { + public void preProcessRequest (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) @@ -303,7 +303,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } } - public void callRESTQueryAAICloudRegion (Execution execution) { + public void callRESTQueryAAICloudRegion (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -353,7 +353,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTQueryAAINetworkId(Execution execution) { + public void callRESTQueryAAINetworkId(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -370,7 +370,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { String aai_endpoint = execution.getVariable("URN_aai_endpoint") AaiUtil aaiUriUtil = new AaiUtil(this) String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution) - String queryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1" + String queryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all" utils.logAudit(queryIdAAIRequest) execution.setVariable(Prefix + "queryIdAAIRequest", queryIdAAIRequest) utils.log("DEBUG", Prefix + "queryIdAAIRequest - " + "\n" + queryIdAAIRequest, isDebugEnabled) @@ -421,7 +421,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTReQueryAAINetworkId(Execution execution) { + public void callRESTReQueryAAINetworkId(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -437,7 +437,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { String aai_endpoint = execution.getVariable("URN_aai_endpoint") AaiUtil aaiUriUtil = new AaiUtil(this) String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution) - String requeryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1" + String requeryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all" utils.logAudit(requeryIdAAIRequest) execution.setVariable(Prefix + "requeryIdAAIRequest", requeryIdAAIRequest) utils.log("DEBUG", " UPDNETI_requeryIdAAIRequest - " + "\n" + requeryIdAAIRequest, isDebugEnabled) @@ -498,7 +498,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTQueryAAINetworkVpnBinding(Execution execution) { + public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -570,9 +570,19 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { utils.log("DEBUG", " AAI Query Vpn Binding Success REST Response, , vpnBinding #" + counting + " : " + "\n" + aaiResponseAsString, isDebugEnabled) String routeTarget = "" - if (utils.nodeExists(aaiResponseAsString, "global-route-target")) { - routeTarget = utils.getNodeText1(aaiResponseAsString, "global-route-target") - routeTargets += "<routeTargets>" + routeTarget + "</routeTargets>" + '\n' + String routeRole = "" + if (utils.nodeExists(aaiResponseAsString, "route-targets")) { + String aaiRouteTargets = utils.getNodeXml(aaiResponseAsString, "route-targets", false) + def aaiRouteTargetsXml = new XmlSlurper().parseText(aaiRouteTargets) + def aaiRouteTarget = aaiRouteTargetsXml.'**'.findAll {it.name() == "route-target"} + for (j in 0..aaiRouteTarget.size()-1) { + routeTarget = utils.getNodeText1(XmlUtil.serialize(aaiRouteTarget[j]), "global-route-target") + routeRole = utils.getNodeText1(XmlUtil.serialize(aaiRouteTarget[j]), "route-target-role") + routeTargets += "<routeTargets>" + '\n' + + " <routeTarget>" + routeTarget + "</routeTarget>" + '\n' + + " <routeTargetRole>" + routeRole + "</routeTargetRole>" + '\n' + + "</routeTargets>" + '\n' + } } } else { @@ -632,7 +642,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTQueryAAINetworkPolicy(Execution execution) { + public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -768,7 +778,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTQueryAAINetworkTableRef(Execution execution) { + public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -904,7 +914,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void callRESTUpdateContrailAAINetwork(Execution execution) { + public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -922,7 +932,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { String aai_endpoint = execution.getVariable("URN_aai_endpoint") AaiUtil aaiUriUtil = new AaiUtil(this) String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution) - String updateContrailAAIUrlRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1" + String updateContrailAAIUrlRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all" utils.logAudit(updateContrailAAIUrlRequest) execution.setVariable(Prefix + "updateContrailAAIUrlRequest", updateContrailAAIUrlRequest) @@ -984,7 +994,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void prepareUpdateNetworkRequest (Execution execution) { + public void prepareUpdateNetworkRequest (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1024,7 +1034,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void prepareSDNCRequest (Execution execution) { + public void prepareSDNCRequest (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1069,7 +1079,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { // Post or Validate Response Section // ************************************************** - public void validateUpdateNetworkResponse (Execution execution) { + public void validateUpdateNetworkResponse (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1142,7 +1152,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void validateSDNCResponse (Execution execution) { + public void validateSDNCResponse (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1178,7 +1188,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void postProcessResponse (Execution execution) { + public void postProcessResponse (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1230,7 +1240,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void prepareSDNCRollbackRequest (Execution execution) { + public void prepareSDNCRollbackRequest (DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix", Prefix) @@ -1264,7 +1274,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void prepareRollbackData(Execution execution) { + public void prepareRollbackData(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) @@ -1300,7 +1310,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void prepareSuccessRollbackData(Execution execution) { + public void prepareSuccessRollbackData(DelegateExecution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) @@ -1342,7 +1352,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { } - public void setExceptionFlag(Execution execution){ + public void setExceptionFlag(DelegateExecution execution){ def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) @@ -1372,7 +1382,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { // Build Error Section // ******************************* - public void processJavaException(Execution execution){ + public void processJavaException(DelegateExecution execution){ def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) try{ |