summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java1
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java9
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java14
3 files changed, 21 insertions, 3 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
index cb4bd81918..aa5da4c790 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java
@@ -35,6 +35,7 @@ public enum ResourceKey {
VPN_BONDING_LINK_ID,
INSTANCE_GROUP_ID,
PNF,
+ PNF_INSTANCE_NAME,
VNF_INSTANCE_NAME,
VF_MODULE_INSTANCE_NAME,
CHILD_SERVICE_INSTANCE_ID,
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
index cfcc1f9f3b..a44d5e972d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java
@@ -44,6 +44,7 @@ public class WorkflowResourceIds implements Serializable {
private String vfModuleInstanceName;
private String childServiceInstanceId;
private String childServiceInstanceName;
+ private String pnfInstanceName;
@@ -178,4 +179,12 @@ public class WorkflowResourceIds implements Serializable {
public void setChildServiceInstanceName(String childServiceInstanceName) {
this.childServiceInstanceName = childServiceInstanceName;
}
+
+ public String getPnfInstanceName() {
+ return pnfInstanceName;
+ }
+
+ public void setPnfInstanceName(String pnfInstanceName) {
+ this.pnfInstanceName = pnfInstanceName;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index b29b95a3b1..a0784b375e 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -264,6 +264,7 @@ public class BBInputSetup implements JavaDelegate {
lookupKeyMap.put(ResourceKey.VF_MODULE_INSTANCE_NAME, workflowResourceIds.getVfModuleInstanceName());
lookupKeyMap.put(ResourceKey.CHILD_SERVICE_INSTANCE_ID, workflowResourceIds.getChildServiceInstanceId());
lookupKeyMap.put(ResourceKey.CHILD_SERVICE_INSTANCE_NAME, workflowResourceIds.getChildServiceInstanceName());
+ lookupKeyMap.put(ResourceKey.PNF_INSTANCE_NAME, workflowResourceIds.getPnfInstanceName());
}
protected GeneralBuildingBlock getGBBALaCarteNonService(ExecuteBuildingBlock executeBB,
@@ -1634,9 +1635,16 @@ public class BBInputSetup implements JavaDelegate {
} else if (bbName.contains(PNF) || (bbName.contains(CONTROLLER)
&& (PNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
String pnfId = lookupKeyMap.get(ResourceKey.PNF);
- resources.getPnfs().stream()
- .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst()
- .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
+ String pnfInstanceName = lookupKeyMap.get(ResourceKey.PNF_INSTANCE_NAME);
+ if (StringUtils.isNotBlank(pnfInstanceName)) {
+ resources.getPnfs().stream().filter(pnfs -> Objects.equals(pnfInstanceName, pnfs.getInstanceName()))
+ .findFirst()
+ .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
+ } else {
+ resources.getPnfs().stream()
+ .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst()
+ .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
+ }
} else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP) || (bbName.contains(CONTROLLER)
&& (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
String vfModuleInstanceName = lookupKeyMap.get(ResourceKey.VF_MODULE_INSTANCE_NAME);