diff options
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy')
3 files changed, 29 insertions, 4 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy index 80e6e758c0..1eb626101e 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy @@ -164,7 +164,8 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso //uuiRequest String incomingRequest = resourceInputObj.getRequestsInputs() String serviceParameters = jsonUtil.getJsonValue(incomingRequest, "service.parameters") - JSONObject inputParameters = new JSONObject(customizeResourceParam(serviceParameters)) + String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs") + JSONObject inputParameters = new JSONObject(customizeResourceParam(requestInputs)) execution.setVariable(Prefix + "ServiceParameters", inputParameters) // CallSource is added only when ONAP SO calling 3rdONAP(External API) SO(Remote call) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index b5d196181b..4939173d65 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -466,6 +466,19 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ") } + // if site location is in local Operator, create all resources in local ONAP; + // if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP + public void doProcessSiteLocation(DelegateExecution execution){ + + msoLogger.trace("======== Start doProcessSiteLocation Process ======== ") + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + String uuiRequest = execution.getVariable("uuiRequest") + ServiceDecomposition serviceDecompositionforLocal = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest); + execution.setVariable("serviceDecomposition", serviceDecompositionforLocal) + + msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ") + } + // prepare input param for using DoCreateResources.bpmn public void preProcessForAddResource(DelegateExecution execution) { msoLogger.trace("STARTED preProcessForAddResource Process ") diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy index 6d23ae7c65..827d44726b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy @@ -336,6 +336,11 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { String sppartnerName = "sp-partner" + eValue jObj.put("resourceType", sppartnerName) } + else if(eKey.equals(rt + ".id")){ + jObj.put("resourceInstanceId", eValue) + String resourceName = rt + eValue; + jObj.put("resourceType", resourceName) + } } def rl_props = utils.getIdenticalChildren(node, "related-to-property") @@ -412,6 +417,8 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { if (serviceRelationShip != null) { relationShipList = jsonSlurper.parseText(serviceRelationShip) } + + List<Resource> deleteRealResourceList = new ArrayList<Resource>(); //Set the real resource instance id to the decomosed resource list for (Resource resource: deleteResourceList) { @@ -421,13 +428,17 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { if (relationShipList != null) { relationShipList.each { if (StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())) { - resource.setResourceId(it.resourceInstanceId); + resource.setResourceId(it.resourceInstanceId) + deleteRealResourceList.add(resource) } } } } - execution.setVariable("deleteResourceList", deleteResourceList) - utils.log("DEBUG", "delete resource list : " + deleteResourceList, isDebugEnabled) + + // only delete real existing resources + execution.setVariable("deleteResourceList", deleteRealResourceList) + + utils.log("DEBUG", "delete resource list : " + deleteRealResourceList, isDebugEnabled) } catch (Exception ex) { String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage() utils.log("DEBUG", exceptionMessage, isDebugEnabled) |