summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java49
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java4
3 files changed, 44 insertions, 11 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 4f64af0110..f8d9d6c96c 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -1220,16 +1220,32 @@ public class ToscaResourceInstaller {
crInstanceGroupCustomization.setModelCustomizationUUID(
networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
- String quantityName = instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
- String fixedQuantity = quantityName.replace("NetworkCollection", "Fixed");
- if (toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- fixedQuantity + "_quantity") != null) {
-
- crInstanceGroupCustomization.setSubInterfaceNetworkQuantity(Integer.parseInt(
- toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- fixedQuantity + "_quantity")));
+ // Loop through the template policy to find the subinterface_network_quantity property name. Then extract the value for it.
+ List<Policy> policyList = toscaResourceStructure.getSdcCsarHelper().getPoliciesOfOriginOfNodeTemplateByToscaPolicyType(networkNodeTemplate, "org.openecomp.policies.scaling.Fixed");
+
+ if(policyList != null){
+ for(Policy policy : policyList){
+ for(String policyNetworkCollection : policy.getTargets()){
+
+ if(policyNetworkCollection.equalsIgnoreCase(group.getName())){
+
+ Map<String, Object> propMap = policy.getPolicyProperties();
+
+ if(propMap.get("quantity") != null){
+
+ String quantity = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, getPropertyInput(propMap.get("quantity").toString()));
+
+ if(quantity != null){
+ crInstanceGroupCustomization.setSubInterfaceNetworkQuantity(Integer.parseInt(quantity));
+ }
+
+ }
+
+ }
+ }
+ }
}
-
+
crInstanceGroupCustomization.setDescription(
toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME)
@@ -1246,7 +1262,6 @@ public class ToscaResourceInstaller {
networkInstanceGroupList.add(networkInstanceGroup);
- //}
toscaResourceStructure.setCatalogNetworkInstanceGroup(networkInstanceGroupList);
@@ -2032,6 +2047,20 @@ public class ToscaResourceInstaller {
+ vfModuleStructure.getVfModuleMetadata().getVfModuleModelName();
}
+ protected String getPropertyInput(String propertyName){
+
+ String inputName = new String();
+
+ if (propertyName != null) {
+ int getInputIndex = propertyName.indexOf("{get_input=");
+ if (getInputIndex > -1) {
+ inputName = propertyName.substring(getInputIndex+11, propertyName.length()-1);
+ }
+ }
+
+ return inputName;
+ }
+
protected static Timestamp getCurrentTimeStamp() {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index f6c9597de8..2e91a52f65 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -89,8 +89,8 @@ public class WorkflowActionBBTasks {
execution.setVariable("completed", true);
} else {
execution.setVariable("completed", false);
- execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
}
+ execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
}
public void updateFlowStatistics(DelegateExecution execution) {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
index 2fc62978fb..17a37c873a 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
@@ -96,7 +96,9 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
execution.setVariable("flowsToExecute", flowsToExecute);
workflowActionBBTasks.selectBB(execution);
boolean success = (boolean) execution.getVariable("completed");
+ int currentSequence = (int) execution.getVariable("gCurrentSequence");
assertEquals(true,success);
+ assertEquals(1,currentSequence);
}
@Test
@@ -115,7 +117,9 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
execution.setVariable("flowsToExecute", flowsToExecute);
workflowActionBBTasks.selectBB(execution);
boolean success = (boolean) execution.getVariable("completed");
+ int currentSequence = (int) execution.getVariable("gCurrentSequence");
assertEquals(false,success);
+ assertEquals(1,currentSequence);
}
@Test