Introduce resource sequence as per modelname 29/49729/1
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>
Thu, 31 May 2018 09:46:32 +0000 (17:46 +0800)
committersubhash kumar singh <subhash.kumar.singh@huawei.com>
Thu, 31 May 2018 09:46:32 +0000 (17:46 +0800)
Resource sequence can be defined in mso.apihandler-infra.properties
file as per following:

mso.workflow.custom.<service-model-name>.resource.sequence=<, separated
values>

Change-Id: I156cfcfea4936be541014726dc6063f7f4e2d2b4
Issue-ID: SO-422
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java

index 9cdbdfd..ab84168 100644 (file)
@@ -105,7 +105,10 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
         List<NetworkResource> networkResourceList = new ArrayList<NetworkResource>()
 
         List<Resource> sequencedResourceList = new ArrayList<Resource>()
-        def resourceSequence = BPMNProperties.getResourceSequenceProp()
+        
+        String serviceDecompose = execution.getVariable("serviceDecomposition")
+        String serviceModelName = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelName")
+        def resourceSequence = BPMNProperties.getResourceSequenceProp(serviceModelName)
 
         if(resourceSequence != null) {
             // sequence is defined in config file
index dbb552c..64d8530 100644 (file)
@@ -47,8 +47,8 @@ public class BPMNProperties {
         return value;
     }
 
-    public static List<String> getResourceSequenceProp() {
-        String resourceSequence = getProperty("mso.workflow.custom.VolTE.resource.sequence", null);
+    public static List<String> getResourceSequenceProp(String input) {
+        String resourceSequence = getProperty("mso.workflow.custom." + input + ".resource.sequence", null);
         if (resourceSequence != null) {
             return Arrays.asList(resourceSequence.split(","));
         }