summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy65
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy21
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy136
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java26
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java9
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java3
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn4
10 files changed, 168 insertions, 122 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
index b94db498bb..7e957be00a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
@@ -110,7 +110,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
String returnCode = apiResponse.getStatusCode()
String apiResponseAsString = apiResponse.getResponseBodyAsString()
String operationStatus = "error";
- if(returnCode== "200"){
+ if(returnCode== "200" || returnCode== "202"){
operationStatus = "finished"
}
execution.setVariable("operationStatus", operationStatus)
@@ -130,7 +130,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
String returnCode = apiResponse.getStatusCode()
String aaiResponseAsString = apiResponse.getResponseBodyAsString()
String jobId = "";
- if(returnCode== "200"){
+ if(returnCode== "200" || returnCode== "202"){
jobId = jsonUtil.getJsonValue(aaiResponseAsString, "jobId")
}
execution.setVariable("jobId", jobId)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
index 41663434db..9d9f0bb25a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
@@ -19,6 +19,7 @@ import org.springframework.web.util.UriUtils
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.xml.sax.InputSource
+import static org.apache.commons.lang3.StringUtils.*
public class DoDeleteVfModuleFromVnf extends VfModuleBase {
@@ -118,19 +119,10 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
utils.logAudit("DoDeleteVfModuleFromVnf: AAI endPoint : " + endPoint)
try {
- RESTConfig config = new RESTConfig(endPoint);
- def responseData = ''
- def aaiRequestId = UUID.randomUUID().toString()
- RESTClient client = new RESTClient(config).
- addHeader('X-TransactionId', aaiRequestId).
- addHeader('X-FromAppId', 'MSO').
- addHeader('Content-Type', 'application/xml').
- addHeader('Accept','application/xml');
- logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
- APIResponse response = client.httpGet()
utils.logAudit("DoDeleteVfModuleFromVnf: - invoking httpGet to AAI")
+ APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
- responseData = response.getResponseBodyAsString()
+ def responseData = response.getResponseBodyAsString()
execution.setVariable('DDVMFV_getVnfResponseCode', response.getStatusCode())
execution.setVariable('DDVMFV_getVnfResponse', responseData)
@@ -416,37 +408,28 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
execution.setVariable("DDVFMV_vnfVfModuleDeleteCompleted", true)
// Parse vnfOutputs for contrail network polcy FQDNs
- if (vnfResponse.contains("vfModuleOutputs")) {
- def vfModuleOutputsXml = utils.getNodeXml(vnfResponse, "vfModuleOutputs")
- InputSource source = new InputSource(new StringReader(vfModuleOutputsXml));
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- docFactory.setNamespaceAware(true)
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
- Document outputsXml = docBuilder.parse(source)
-
- NodeList entries = outputsXml.getElementsByTagNameNS("*", "entry")
+ def vfModuleOutputsXml = utils.getNodeXml(vnfResponse, "vfModuleOutputs")
+ if(!isBlank(vfModuleOutputsXml)) {
+ vfModuleOutputsXml = utils.removeXmlNamespaces(vfModuleOutputsXml)
List contrailNetworkPolicyFqdnList = []
- for (int i = 0; i< entries.getLength(); i++) {
- Node node = entries.item(i)
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node
- String key = element.getElementsByTagNameNS("*", "key").item(0).getTextContent()
- if (key.endsWith("contrail_network_policy_fqdn")) {
- String contrailNetworkPolicyFqdn = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- logDebug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn, isDebugLogEnabled)
- contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn)
- }
- else if (key.equals("oam_management_v4_address")) {
- String oamManagementV4Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- logDebug("Obtained oamManagementV4Address: " + oamManagementV4Address, isDebugLogEnabled)
- execution.setVariable(Prefix + "oamManagementV4Address", oamManagementV4Address)
- }
- else if (key.equals("oam_management_v6_address")) {
- String oamManagementV6Address = element.getElementsByTagNameNS("*", "value").item(0).getTextContent()
- logDebug("Obtained oamManagementV6Address: " + oamManagementV6Address, isDebugLogEnabled)
- execution.setVariable(Prefix + "oamManagementV6Address", oamManagementV6Address)
- }
-
+ for(Node node: utils.getMultNodeObjects(vfModuleOutputsXml, "entry")) {
+ String key = utils.getChildNodeText(node, "key")
+ if(key == null) {
+
+ } else if (key.endsWith("contrail_network_policy_fqdn")) {
+ String contrailNetworkPolicyFqdn = utils.getChildNodeText(node, "value")
+ logDebug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn, isDebugLogEnabled)
+ contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn)
+ }
+ else if (key.equals("oam_management_v4_address")) {
+ String oamManagementV4Address = utils.getChildNodeText(node, "value")
+ logDebug("Obtained oamManagementV4Address: " + oamManagementV4Address, isDebugLogEnabled)
+ execution.setVariable(Prefix + "oamManagementV4Address", oamManagementV4Address)
+ }
+ else if (key.equals("oam_management_v6_address")) {
+ String oamManagementV6Address = utils.getChildNodeText(node, "value")
+ logDebug("Obtained oamManagementV6Address: " + oamManagementV6Address, isDebugLogEnabled)
+ execution.setVariable(Prefix + "oamManagementV6Address", oamManagementV6Address)
}
}
if (!contrailNetworkPolicyFqdnList.isEmpty()) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index 703ea8be6d..dd6d4514bc 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -343,6 +343,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// VNFs
List<VnfResource> vnfList = serviceDecomposition.getServiceVnfs()
+ filterVnfs(vnfList)
+ serviceDecomposition.setServiceVnfs(vnfList)
+
execution.setVariable("vnfList", vnfList)
execution.setVariable("vnfListString", vnfList.toString())
@@ -372,6 +375,24 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
+
+ private void filterVnfs(List<VnfResource> vnfList) {
+ if(vnfList == null) {
+ return
+ }
+
+ // remove BRG & TXC from VNF list
+
+ Iterator<VnfResource> it = vnfList.iterator()
+ while(it.hasNext()) {
+ VnfResource vr = it.next()
+
+ String role = vr.getNfRole()
+ if(role == "BRG" || role == "TunnelXConn") {
+ it.remove()
+ }
+ }
+ }
public void prepareCreateAllottedResourceTXC(Execution execution) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
index 77ef3f6fe0..16fb22a6d3 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy
@@ -30,6 +30,7 @@ import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.rest.APIResponse
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import java.util.UUID;
@@ -40,6 +41,7 @@ import org.json.JSONArray;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils;
+import static org.apache.commons.lang3.StringUtils.*
/**
* This groovy class supports the <class>DeleteVcpeResCustService.bpmn</class> process.
@@ -145,7 +147,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("tenantId", tenantId)
utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
- String sdncVersion = "1702"
+ String sdncVersion = "1707"
execution.setVariable("sdncVersion", sdncVersion)
utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)
@@ -194,7 +196,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareServiceDelete(Execution execution) {
def isDebugEnabled=execution.getVariable(DebugFlag)
- utils.log("DEBUG", " ***** Inside prepareServiceInstanceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Inside prepareServiceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
@@ -214,81 +216,95 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
String serviceInstanceAaiRecord = execution.getVariable("GENGS_service");
utils.log("DEBUG", "serviceInstanceAaiRecord: "+serviceInstanceAaiRecord, isDebugEnabled)
+ serviceInstanceAaiRecord = utils.removeXmlNamespaces(serviceInstanceAaiRecord)
- // determine if AR needs to be deleted
- boolean DVRCS_TunnelXConn = false
- boolean DVRCS_BRG = false
- String TXC_allottedResourceId
- String BRG_allottedResourceId
- XmlParser xmlParser = new XmlParser()
- def groovy.util.Node siNode = xmlParser.parseText(serviceInstanceAaiRecord)
- def groovy.util.Node arList = utils.getChildNode(siNode, 'allotted-resources')
- if (arList != null) {
- def groovy.util.NodeList ars = utils.getIdenticalChildren(arList, 'allotted-resource')
- for (groovy.util.Node ar in ars) {
- def type = utils.getChildNodeText(ar, 'type')
- if ("TunnelXConn".equals(type)) {
+ def (TXC_found, TXC_id) = new Tuple(false, null)
+ def (BRG_found, BRG_id) = new Tuple(false, null)
+ List relatedVnfIdList = []
+
+ for(Node rel: utils.getMultNodeObjects(serviceInstanceAaiRecord, "relationship")) {
+ def relto = utils.getChildNodeText(rel, "related-to")
+ def relink = utils.getChildNodeText(rel, "related-link")
+ utils.log("DEBUG", "check: "+relto+" link: "+relink, isDebugEnabled)
+
+ if(isBlank(relto) || isBlank(relink)) {
+
+ } else if(relto == "generic-vnf") {
+ def id = relink.substring(relink.indexOf("/generic-vnf/")+13)
+ if(id.endsWith("/")) {
+ id = id.substring(0, id.length()-1)
+ }
+
+ relatedVnfIdList.add(id)
+
+ } else if(relto == "allotted-resource") {
+ def (type, id) = getAaiAr(execution, relink)
+
+ if(isBlank(type) || isBlank(id)) {
+
+ } else if(type == "TunnelXConn") {
utils.log("DEBUG","TunnelXConn AR found", isDebugEnabled)
- def id = utils.getChildNodeText(ar, 'id')
- if (id != null){
- DVRCS_TunnelXConn = true
- TXC_allottedResourceId = id
- }
- } else if ("BRG".equals(type)) {
- utils.log("DEBUG","FW AR found", isDebugEnabled)
- def id = utils.getChildNodeText(ar, 'id')
- if (id != null){
- DVRCS_BRG = true
- BRG_allottedResourceId = id
- }
+ TXC_found = true
+ TXC_id = id
+
+ } else if(type == "BRG") {
+ utils.log("DEBUG","BRG AR found", isDebugEnabled)
+ BRG_found = true
+ BRG_id = id
}
}
}
- execution.setVariable(Prefix+"TunnelXConn", DVRCS_TunnelXConn)
- utils.log("DEBUG", Prefix+"TunnelXConn : " + DVRCS_TunnelXConn, isDebugEnabled)
- execution.setVariable("TXC_allottedResourceId", TXC_allottedResourceId)
- utils.log("DEBUG", "TXC_allottedResourceId : " + TXC_allottedResourceId, isDebugEnabled)
- execution.setVariable(Prefix+"BRG", DVRCS_BRG)
- utils.log("DEBUG", Prefix+"BRG : " + DVRCS_BRG, isDebugEnabled)
- execution.setVariable("BRG_allottedResourceId", BRG_allottedResourceId)
- utils.log("DEBUG", "BRG_allottedResourceId : " + BRG_allottedResourceId, isDebugEnabled)
-
- String relationship = ""
- try {
- relationship = networkUtils.getFirstNodeXml(serviceInstanceAaiRecord, "relationship-list")
- } catch (Exception ex) {
- //no relationships found
- }
- utils.log("DEBUG", " relationship string - " + relationship, isDebugEnabled)
+ execution.setVariable(Prefix+"TunnelXConn", TXC_found)
+ execution.setVariable("TXC_allottedResourceId", TXC_id)
+ utils.log("DEBUG", "TXC_allottedResourceId: " + TXC_id, isDebugEnabled)
+
+ execution.setVariable(Prefix+"BRG", BRG_found)
+ execution.setVariable("BRG_allottedResourceId", BRG_id)
+ utils.log("DEBUG", "BRG_allottedResourceId: " + BRG_id, isDebugEnabled)
- int vnfsCount = 0
-
- if (relationship != null && relationship.length() > 0){
- relationship = relationship.trim().replace("tag0:","").replace(":tag0","")
-
- // Check if Network TableREf is present, then build a List of network policy
- List relatedVnfIdList = networkUtils.getRelatedVnfIdList(relationship)
- vnfsCount = relatedVnfIdList.size()
- execution.setVariable(Prefix+"vnfsCount", vnfsCount)
- utils.log("DEBUG", " "+Prefix+"vnfsCount : " + vnfsCount, isDebugEnabled)
+ int vnfsCount = relatedVnfIdList.size()
+ execution.setVariable(Prefix+"vnfsCount", vnfsCount)
+ utils.log("DEBUG", " "+Prefix+"vnfsCount : " + vnfsCount, isDebugEnabled)
+ if(vnfsCount > 0) {
execution.setVariable(Prefix+"relatedVnfIdList", relatedVnfIdList)
- } else {
- execution.setVariable(Prefix+"vnfsCount", 0)
- utils.log("DEBUG", " "+Prefix+"vnfsCount : " + vnfsCount, isDebugEnabled)
}
- utils.log("DEBUG", " ***** Completed prepareServiceInstanceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Completed prepareServiceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
} catch (BpmnError e){
throw e;
} catch (Exception ex) {
sendSyncError(execution)
- String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. prepareServiceInstanceDelete() - " + ex.getMessage()
- utils.log("DEBUG", exceptionMessage, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. prepareServiceDelete() - " + ex.getMessage()
+ utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
+ private getAaiAr(Execution execution, String relink) {
+ def isDebugEnabled = execution.getVariable(DebugFlag)
+ AaiUtil aaiUtil = new AaiUtil(this)
+ String aaiEndpoint = execution.getVariable("URN_aai_endpoint") + relink
+
+ utils.log("DEBUG", "get AR info " + aaiEndpoint, isDebugEnabled)
+ APIResponse response = aaiUtil.executeAAIGetCall(execution, aaiEndpoint)
+
+ int responseCode = response.getStatusCode()
+ utils.log("DEBUG", "get AR info responseCode:" + responseCode, isDebugEnabled)
+
+ String aaiResponse = response.getResponseBodyAsString()
+ utils.log("DEBUG", "get AR info " + aaiResponse, isDebugEnabled)
+
+ if(responseCode < 200 || responseCode >= 300 || isBlank(aaiResponse)) {
+ return new Tuple2(null, null)
+ }
+
+ def type = utils.getNodeText1(aaiResponse, "type")
+ def id = utils.getNodeText1(aaiResponse, "id")
+
+ return new Tuple2(type, id)
+ }
+
// *******************************
//
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
index 167c9c8b54..38ac23e5a1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy
@@ -46,6 +46,9 @@ import static org.apache.commons.lang3.StringUtils.*
* @param - disableRollback - O ignored
* @param - failNotfound - O
* @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
+ * @param - parentServiceInstanceId
* @param - allottedResourceId
*
* Outputs:
@@ -155,6 +158,8 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
String allottedResourceId = execution.getVariable("allottedResourceId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
+ String globalCustomerId = execution.getVariable("globalCustomerId")
+ String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
String callbackUrl = execution.getVariable("sdncCallbackUrl")
String requestId = execution.getVariable("msoRequestId")
@@ -194,11 +199,11 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{
</request-information>
<service-information>
<service-id></service-id>
- <subscription-service-type></subscription-service-type>
+ <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
<onap-model-information></onap-model-information>
- <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
<subscriber-name/>
- <global-customer-id></global-customer-id>
+ <global-customer-id>${globalCustomerId}</global-customer-id>
</service-information>
<allotted-resource-information>
<allotted-resource-id>${allottedResourceId}</allotted-resource-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
index eb045eb54b..a5b7c1350d 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy
@@ -46,6 +46,9 @@ import static org.apache.commons.lang3.StringUtils.*
* @param - disableRollback - O ignored
* @param - failNotfound - O
* @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
+ * @param - parentServiceInstanceId
* @param - allottedResourceId
*
* Outputs:
@@ -155,6 +158,8 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
String allottedResourceId = execution.getVariable("allottedResourceId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
+ String globalCustomerId = execution.getVariable("globalCustomerId")
+ String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
String callbackUrl = execution.getVariable("sdncCallbackUrl")
String requestId = execution.getVariable("msoRequestId")
@@ -194,11 +199,11 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{
</request-information>
<service-information>
<service-id></service-id>
- <subscription-service-type></subscription-service-type>
+ <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
<onap-model-information></onap-model-information>
- <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
<subscriber-name/>
- <global-customer-id></global-customer-id>
+ <global-customer-id>${globalCustomerId}</global-customer-id>
</service-information>
<allotted-resource-information>
<allotted-resource-id>${allottedResourceId}</allotted-resource-id>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
index 6ca93f7238..823223fbd8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
@@ -44,6 +44,7 @@ import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.Generic
import org.openecomp.mso.logger.MessageEnum;
import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.mso.requestsdb.RequestsDatabase;
+import org.openecomp.mso.requestsdb.RequestsDbConstant;
import org.openecomp.mso.requestsdb.ResourceOperationStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -330,9 +331,10 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
logger.info("AbstractSdncOperationTask.execute begin!");
GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(execution);
// updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!");
- Map<String, String> inputs = getInputs(execution);
-// updateProgress(execution, null, null, "30", "getGenericResourceApiClient finished!");
try {
+ Map<String, String> inputs = getInputs(execution);
+// updateProgress(execution, null, null, "30", "getGenericResourceApiClient finished!");
+
sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient);
execution.setVariable("SDNCA_SuccessIndicator", true);
// updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
@@ -341,6 +343,8 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
logger.error("exception: AbstractSdncOperationTask.fail!:", e);
e.printStackTrace();
execution.setVariable("SDNCA_SuccessIndicator", false);
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100", "sendRestrequestAndHandleResponse finished!");
+
}
logger.info("AbstractSdncOperationTask.execute end!");
}
@@ -349,16 +353,18 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
logger.info("AbstractSdncOperationTask.getInputs begin!");
Map<String, String> inputs = new HashMap<>();
String json = (String) execution.getVariable(SDCADAPTOR_INPUTS);
- JSONObject jsonObject = new JSONObject(json);
- JSONObject paras = jsonObject.getJSONObject("additionalParamForNs");
- Iterator<String> iterator = paras.keys();
- while (iterator.hasNext()) {
- String key = iterator.next();
- inputs.put(key, paras.getString(key));
- }
+ if (!StringUtils.isBlank(json)) {
+ JSONObject jsonObject = new JSONObject(json);
+ JSONObject paras = jsonObject.getJSONObject("additionalParamForNs");
+ Iterator<String> iterator = paras.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ inputs.put(key, paras.getString(key));
+ }
/* if (paras.keys().hasNext()) {
paras.keySet().stream().forEach(key -> inputs.put(key, paras.getString((String) key)));
}*/
+ }
logger.info("AbstractSdncOperationTask.getInputs end!");
return inputs;
}
@@ -374,8 +380,10 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
String statusDescription) {
logger.info("AbstractSdncOperationTask.updateProgress begin!");
String serviceId = (String) execution.getVariable("serviceId");
+ serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
String operationId = (String) execution.getVariable("operationId");
String resourceTemplateUUID = (String) execution.getVariable("resourceUUID");
+ resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId") : resourceTemplateUUID;
try {
ResourceOperationStatus resourceOperationStatus = getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
if (!StringUtils.isBlank(status)) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
index e8bfcf5caa..698f0c54dc 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java
@@ -52,10 +52,10 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
Map<String, String> inputs,
GenericResourceApi genericResourceApiClient) throws Exception {
logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!");
- updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!");
+ updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40", "sendRestrequestAndHandleResponse begin!");
NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder();
RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs);
- updateProgress(execution, null, null, "50", "RequestBody build finished!");
+ updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "50", "RequestBody build finished!");
RpcNetworkTopologyOperationOutputEntity outputEntity;
if (!isSend2SdncDirectly()) {
outputEntity = genericResourceApiClient.postNetworkTopologyOperation
@@ -65,6 +65,7 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
} else {
Send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity);
}
+ updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
logger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!");
}
@@ -91,11 +92,11 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask
String errorMessage = output.getOutput().getResponseMessage();
WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage);
execution.setVariable("SDNCA_SuccessIndicator", workflowException);
- updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage);
+ updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), "100", errorMessage);
logger.info("exception: SdncNetworkTopologyOperationTask.saveOutput fail!");
throw new Exception("");
}
- updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!");
+
logger.info("SdncNetworkTopologyOperationTask.saveOutput end!");
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
index 119ac42e76..869c7783ef 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java
@@ -20,6 +20,7 @@
package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask;
+import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.openecomp.mso.bpmn.core.BaseTask;
import org.openecomp.mso.requestsdb.RequestsDatabase;
@@ -40,8 +41,10 @@ public class SdncUnderlayVpnPreprocessTask extends BaseTask {
private String getOperType(DelegateExecution execution) {
String serviceId = (String) execution.getVariable("serviceId");
+ serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId;
String operationId = (String) execution.getVariable("operationId");
String resourceTemplateUUID = (String) execution.getVariable("resourceUUID");
+ resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId") : resourceTemplateUUID;
ResourceOperationStatus resourceOperationStatus = requestsDB.getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
return resourceOperationStatus.getOperType();
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
index 88c45afda2..e8b18e6dca 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteVcpeResCustService.bpmn
@@ -181,6 +181,8 @@ DeleteVcpeResCustService.prepareServiceDelete(execution)]]></bpmn2:script>
<camunda:in source="BRG_allottedResourceId" target="allottedResourceId" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="rolledBack" target="rolledBack" />
+ <camunda:in source="globalCustomerId" target="globalCustomerId" />
+ <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_05cjs89</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0snq0kw</bpmn2:outgoing>
@@ -235,6 +237,8 @@ DeleteVcpeResCustService.prepareServiceDelete(execution)]]></bpmn2:script>
<camunda:in source="TXC_allottedResourceId" target="allottedResourceId" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:out source="rolledBack" target="rolledBack" />
+ <camunda:in source="globalCustomerId" target="globalCustomerId" />
+ <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0npvfo3</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0et9p0i</bpmn2:outgoing>