From b4eec19d67a562762b5198f0c9d8dc283f66511b Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Mon, 6 May 2019 10:37:09 +0530 Subject: Invoke prepare instance resource list from bpmn Invoke prepare instance resource list from bpmn. Change-Id: I9a116eaee3800bfc061f986e0e5aea75d2f88598 Issue-ID: SO-1393 Signed-off-by: subhash kumar singh --- .../scripts/DoCreateResources.groovy | 14 +- .../resources/subprocess/DoCreateResources.bpmn | 151 +++++++++++---------- 2 files changed, 90 insertions(+), 75 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy index 0240beab9a..fd698d486f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -209,11 +209,11 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ public void getCurrentResoure(DelegateExecution execution){ logger.trace("Start getCurrentResoure Process ") def currentIndex = execution.getVariable("currentResourceIndex") - List sequencedResourceList = execution.getVariable("sequencedResourceList") - Resource currentResource = sequencedResourceList.get(currentIndex) + List instanceResourceList = execution.getVariable("instanceResourceList") + Resource currentResource = instanceResourceList.get(currentIndex) execution.setVariable("resourceType", currentResource.getModelInfo().getModelName()) - logger.info("Now we deal with resouce:" + currentResource.getModelInfo().getModelName()) - logger.trace("COMPLETED getCurrentResoure Process ") + logger.info("Now we deal with resource:" + currentResource.getModelInfo().getModelName()) + logger.trace("COMPLETED getCurrentResource Process ") } public void parseNextResource(DelegateExecution execution){ @@ -221,8 +221,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ def currentIndex = execution.getVariable("currentResourceIndex") def nextIndex = currentIndex + 1 execution.setVariable("currentResourceIndex", nextIndex) - List sequencedResourceList = execution.getVariable("sequencedResourceList") - if(nextIndex >= sequencedResourceList.size()){ + List instanceResourceList = execution.getVariable("instanceResourceList") + if(nextIndex >= instanceResourceList.size()){ execution.setVariable("allResourceFinished", "true") }else{ execution.setVariable("allResourceFinished", "false") @@ -249,7 +249,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ resourceInput.setOperationId(operationId) resourceInput.setOperationType(operationType); def currentIndex = execution.getVariable("currentResourceIndex") - List sequencedResourceList = execution.getVariable("sequencedResourceList") + List sequencedResourceList = execution.getVariable("instanceResourceList") Resource currentResource = sequencedResourceList.get(currentIndex) resourceInput.setResourceModelInfo(currentResource.getModelInfo()); ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn index dc2cf9b676..75767929aa 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qiiycn @@ -7,17 +7,17 @@ SequenceFlow_1qiiycn SequenceFlow_0w9t6tc - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateResources() dcsi.preProcessRequest(execution) -]]> + SequenceFlow_16nxl6h SequenceFlow_0epxs3b - import org.onap.so.bpmn.infrastructure.scripts.* def csi = new DoCreateResources() -csi.postConfigRequest(execution)]]> +csi.postConfigRequest(execution) SequenceFlow_0k0f7lm @@ -27,9 +27,9 @@ csi.postConfigRequest(execution)]]> SequenceFlow_1hbesp9 SequenceFlow_13d9g1n - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.sequenceResoure(execution)]]> +ddsi.sequenceResoure(execution) @@ -41,18 +41,18 @@ ddsi.sequenceResoure(execution)]]> SequenceFlow_13c7bhn SequenceFlow_1jenxlp - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.parseNextResource(execution)]]> +ddsi.parseNextResource(execution) SequenceFlow_0q6uy30 - SequenceFlow_1qozd66 + SequenceFlow_1obf0cq SequenceFlow_0uiygod - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.getCurrentResoure(execution)]]> +ddsi.getCurrentResoure(execution) SequenceFlow_13d9g1n @@ -63,16 +63,16 @@ ddsi.getCurrentResoure(execution)]]> SequenceFlow_0uiygod SequenceFlow_1u9k0dm - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.prepareResourceRecipeRequest(execution)]]> +ddsi.prepareResourceRecipeRequest(execution) SequenceFlow_1u9k0dm SequenceFlow_13c7bhn - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.executeResourceRecipe(execution)]]> +ddsi.executeResourceRecipe(execution) SequenceFlow_0w9t6tc @@ -86,7 +86,7 @@ ddsi.executeResourceRecipe(execution)]]> - + #{(execution.getVariable("isContainsWanResource" ) == "true" )} SequenceFlow_1hbesp9 @@ -98,12 +98,12 @@ ddsi.executeResourceRecipe(execution)]]> - + #{(execution.getVariable("allResourceFinished" ) == "true" )} - + SequenceFlow_0epxs3b @@ -119,9 +119,9 @@ ddsi.executeResourceRecipe(execution)]]> SequenceFlow_0gr9xqj SequenceFlow_0a6l29p - import org.onap.so.bpmn.common.scripts.* ExceptionUtil ex = new ExceptionUtil() -ex.processJavaException(execution)]]> +ex.processJavaException(execution) @@ -129,11 +129,19 @@ ex.processJavaException(execution)]]> SequenceFlow_1vprtt9 SequenceFlow_0k0f7lm - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateResources() -ddsi.prepareServiceTopologyRequest(execution)]]> +ddsi.prepareServiceTopologyRequest(execution) + + + SequenceFlow_1qozd66 + SequenceFlow_1obf0cq + import org.onap.so.bpmn.infrastructure.scripts.* +def ddsi = new DoCreateResources() +ddsi.prepareInstanceResourceList(execution) + @@ -155,10 +163,10 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - - - + + + + @@ -167,8 +175,8 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + @@ -180,10 +188,10 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - - - + + + + @@ -192,8 +200,8 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + @@ -208,8 +216,8 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + @@ -227,17 +235,17 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + - - - - + + + + @@ -249,9 +257,9 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - - + + + @@ -263,49 +271,49 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + - + - + - - + + - - + + - - + + - - + + - - + + @@ -317,8 +325,8 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + @@ -342,15 +350,15 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + - - + + @@ -359,12 +367,19 @@ ddsi.prepareServiceTopologyRequest(execution)]]> - - + + + + + + + + + -- cgit 1.2.3-korg