summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src
diff options
context:
space:
mode:
authorzm330 <zhangminyj@chinamobile.com>2020-05-16 22:54:57 +0800
committerZhang Min <zhangminyj@chinamobile.com>2020-05-18 17:16:25 +0000
commitb6b317acefcf741afe56cb9899769c01c707c557 (patch)
tree200d5bde04b5e5fb937c26b6ae6a574958f82e27 /bpmn/so-bpmn-infrastructure-common/src
parent959d27a96f24cf74dfa3764df64b65a1ba9b9cbb (diff)
Add relationship to allocate resource
Issue-ID: SO-2919 Signed-off-by: zm330 <zhangminyj@chinamobile.com> Change-Id: I4232439be1729255fc128b268b1a3168d51507ff
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy23
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy4
2 files changed, 13 insertions, 14 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
index cc2d865957..4a8469cc8d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
@@ -111,13 +111,11 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi
}
void updateRelationship(DelegateExecution execution) {
- logger.trace("Enter update relationship in DoAllocateNSIandNSSI()")
- String nsiServiceInstanceId = execution.getVariable("nsiServiceInstanceId")
+ logger.debug("Enter update relationship in DoAllocateNSIandNSSI()")
String allottedResourceId = execution.getVariable("allottedResourceId")
//Need to check whether nsi exist : Begin
org.onap.aai.domain.yang.ServiceInstance nsiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance()
SliceTaskParams sliceParams = execution.getVariable("sliceParams")
-
String nsiServiceInstanceID = sliceParams.getSuggestNsiId()
AAIResourcesClient resourceClient = new AAIResourcesClient()
@@ -136,14 +134,8 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi
// exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai to " +
// "associate for service :"+serviceInstanceId)
// }
- }catch(BpmnError e) {
- throw e;
- }catch (Exception ex){
- String msg = "NSI suggested in the option doesn't exist. " + nsiServiceInstanceID
- logger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
- }
- AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), nsiServiceInstanceId, allottedResourceId)
+
+ AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), execution.getVariable("sliceServiceInstanceId"), allottedResourceId)
getAAIClient().connect(allottedResourceUri,nsiServiceuri)
List<String> nssiAssociated = new ArrayList<>()
@@ -160,7 +152,14 @@ class DoAllocateNSIandNSSI extends org.onap.so.bpmn.common.scripts.AbstractServi
}
execution.setVariable("nssiAssociated",nssiAssociated)
execution.setVariable("nsiServiceInstanceName",nsiServiceInstance.getServiceInstanceName())
- logger.trace("Exit update relationship in DoAllocateNSIandNSSI()")
+ }catch(BpmnError e) {
+ throw e
+ }catch (Exception ex){
+ String msg = "NSI suggested in the option doesn't exist. " + nsiServiceInstanceID
+ logger.debug(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ logger.debug("Exit update relationship in DoAllocateNSIandNSSI()")
}
void prepareNssiModelInfo(DelegateExecution execution){
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
index 2d0034a34d..570b6a5ed7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy
@@ -227,7 +227,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
}
void updateRelationship(DelegateExecution execution) {
- logger.trace("Enter updateRelationship in DoAllocateNSSI()")
+ logger.debug("Enter updateRelationship in DoAllocateNSSI()")
String nssiInstanceId = execution.getVariable("nssiInstanceId")
String nsiInstanceId = execution.getVariable("nsiServiceInstanceId")
try{
@@ -239,7 +239,7 @@ class DoAllocateNSSI extends org.onap.so.bpmn.common.scripts.AbstractServiceTask
logger.info(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- logger.trace("Exit updateRelationship in DoAllocateNSSI()")
+ logger.debug("Exit updateRelationship in DoAllocateNSSI()")
}