From 8d496b4f1516d25e39bbd909cb7185e74a453cc6 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 6 Nov 2017 10:27:21 -0500 Subject: Updated xml tags and moved sleep to bpmn Per issue, changed "_" to "-". Also related to a comment to SO-303, made "sleep" time a property and moved the sleep calls from groovy scripts to bpmn. Fixed a few test resources that still had "_" instead of "-". Changed variable name from sdnReplDelay to sdncReplDelay. Change-Id: I893254c0ab735508732fcf2c3e82934f26c2a05a Issue-Id: SO-308 Signed-off-by: Jim Hahn --- .../vcpe/scripts/CreateVcpeResCustService.groovy | 29 +++++------ .../scripts/DoCreateAllottedResourceBRG.groovy | 14 ++++-- .../scripts/DoCreateAllottedResourceTXC.groovy | 18 ++++--- .../process/CreateVcpeResCustService.bpmn | 57 +++++++++++----------- .../subprocess/DoCreateAllottedResourceBRG.bpmn | 32 +++++++++--- .../subprocess/DoCreateAllottedResourceTXC.bpmn | 44 ++++++++++++----- 6 files changed, 118 insertions(+), 76 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index dba1a8b581..703ea8be6d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -40,6 +40,7 @@ import org.json.JSONArray; import org.apache.commons.lang3.* import org.apache.commons.codec.binary.Base64; import org.springframework.web.util.UriUtils; +import static org.apache.commons.lang3.StringUtils.* /** * This groovy class supports the CreateVcpeResCustService.bpmn process. @@ -93,6 +94,16 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { // initialize flow variables InitializeProcessVariables(execution) + //Config Inputs + String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay') + if (isBlank(aaiDistDelay)) { + msg = "URN_mso_workflow_aai_distribution_delay is null" + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + execution.setVariable("aaiDistDelay", aaiDistDelay) + utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled) + // check for incoming json message/input String createVcpeServiceRequest = execution.getVariable("bpmnRequest") utils.logAudit(createVcpeServiceRequest) @@ -363,24 +374,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { } - public void awaitAaiDistribution(Execution execution) { - def isDebugEnabled=execution.getVariable(DebugFlag) - - try { - String tsleep = execution.getVariable("junitSleepMs") - - //workaround for aai replication issue - utils.log("DEBUG", "sleeping while AAI distributes data", isDebugEnabled) - sleep(tsleep == null ? 30000 : tsleep as Long) - - } catch (Exception ex) { - // try error in method block - String exceptionMessage = "Unexpected Error from method awaitAaiDistribution() - " + ex.getMessage() - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - } - } - - public void prepareCreateAllottedResourceTXC(Execution execution) { def isDebugEnabled=execution.getVariable(DebugFlag) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy index b46721c88e..54e23a97e6 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy @@ -89,6 +89,15 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ execution.setVariable("sdncCallbackUrl", sdncCallbackUrl) utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled) + String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay') + if (isBlank(sdncReplDelay)) { + msg = "URN_mso_workflow_sdnc_replication_delay is null" + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + execution.setVariable("sdncReplDelay", sdncReplDelay) + utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled) + //Request Inputs if (isBlank(execution.getVariable("serviceInstanceId"))){ msg = "Input serviceInstanceId is null" @@ -562,11 +571,6 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ String serviceInstanceId = execution.getVariable("serviceInstanceId") String sdncRequestId = UUID.randomUUID().toString() - - String tsleep = execution.getVariable("junitSleepMs") - - //workaround for sdnc replication issue - sleep(tsleep == null ? 5000 : tsleep as Long) //neeed the same url as used by vfmodules String SDNCGetRequest = diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy index 8a4e591654..c9edf05d6c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy @@ -93,6 +93,15 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ execution.setVariable("sdncCallbackUrl", sdncCallbackUrl) utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled) + String sdncReplDelay = execution.getVariable('URN_mso_workflow_sdnc_replication_delay') + if (isBlank(sdncReplDelay)) { + msg = "URN_mso_workflow_sdnc_replication_delay is null" + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + execution.setVariable("sdncReplDelay", sdncReplDelay) + utils.log("DEBUG","SDNC replication delay: " + sdncReplDelay, isDebugEnabled) + //Request Inputs if (isBlank(execution.getVariable("serviceInstanceId"))){ msg = "Input serviceInstanceId is null" @@ -554,11 +563,6 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ String serviceInstanceId = execution.getVariable("serviceInstanceId") String sdncRequestId = UUID.randomUUID().toString() - - String tsleep = execution.getVariable("junitSleepMs") - - //workaround for sdnc replication issue - sleep(tsleep == null ? 5000 : tsleep as Long) //neeed the same url as used by vfmodules String SDNCGetRequest = @@ -606,8 +610,8 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ String txca = utils.getNodeXml(arData, "tunnelxconn-assignments") execution.setVariable("vni", utils.getNodeText1(txca, "vni")) - execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux_bearer_ip")) - execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux_lan_ip")) + execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux-bearer-ip")) + execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux-lan-ip")) String ari = utils.getNodeXml(arData, "allotted-resource-identifiers") execution.setVariable("allotedResourceName", utils.getNodeText1(ari, "allotted-resource-name")) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn index 3c5e26874a..175efaf8b5 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVcpeResCustService.bpmn @@ -366,9 +366,8 @@ CreateVcpeResCustService.prepareCreateServiceInstance(execution)]]> SequenceFlow_0vj46ej - SequenceFlow_13uceka + SequenceFlow_0sjpja4 - SequenceFlow_1ky2sv9 SequenceFlow_0vj46ej @@ -431,7 +430,7 @@ CreateVcpeResCustService.prepareCreateAllottedResourceTXC(execution)]]> - SequenceFlow_16acruh + SequenceFlow_1db0ri1 @@ -616,14 +615,15 @@ CreateVcpeResCustService.validateVnfCreate(execution)]]> SequenceFlow_0e9e6fo - - SequenceFlow_13uceka - SequenceFlow_16acruh - - - + + SequenceFlow_0sjpja4 + SequenceFlow_1db0ri1 + + ${aaiDistDelay} + + + + @@ -921,13 +921,6 @@ CreateVcpeResCustService.awaitAaiDistribution(execution)]]> - - - - - - - @@ -1151,9 +1144,9 @@ CreateVcpeResCustService.awaitAaiDistribution(execution)]]> - + - + @@ -1508,16 +1501,24 @@ CreateVcpeResCustService.awaitAaiDistribution(execution)]]> - - + + + + + - - - - - + + + + + + + + + + - + diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn index a35371e97c..b925b007cd 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceBRG.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1 @@ -180,7 +180,7 @@ dcar.validateSDNCResp(execution, response, "activate" )]]> SequenceFlow_0q1hz2p - + @@ -277,8 +277,8 @@ DoCreateAllottedResourceBRG dcar = new DoCreateAllottedResourceBRG() dcar.updateAaiAROrchStatus(execution, "Created")]]> - SequenceFlow_1dgzhsm SequenceFlow_0z8luou + SequenceFlow_0ec9eiq SequenceFlow_030mhcm + + SequenceFlow_1dgzhsm + SequenceFlow_0ec9eiq + + ${sdncReplDelay} + + + @@ -532,10 +540,9 @@ dcar.generateOutputs(execution)]]> - - + - + @@ -730,6 +737,19 @@ dcar.generateOutputs(execution)]]> + + + + + + + + + + + + + diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn index 178534f797..a240bb5ffa 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateAllottedResourceTXC.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1 @@ -180,7 +180,6 @@ dcar.validateSDNCResp(execution, response, "activate" )]]> SequenceFlow_0q1hz2p - @@ -262,7 +261,7 @@ dcar.postProcessRollback(execution)]]> SequenceFlow_00i7x43 - SequenceFlow_1dgzhsm + SequenceFlow_07kxd8t - SequenceFlow_1dgzhsm SequenceFlow_0z8luou + SequenceFlow_08hhqb2 SequenceFlow_030mhcm + + + SequenceFlow_07kxd8t + SequenceFlow_08hhqb2 + + ${sdncReplDelay} + + + @@ -530,14 +538,6 @@ dcar.generateOutputs(execution)]]> - - - - - - - - @@ -730,6 +730,26 @@ dcar.generateOutputs(execution)]]> + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg