summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2017-11-06 10:27:21 -0500
committerJim Hahn <jrh3@att.com>2017-11-06 11:11:22 -0500
commit8d496b4f1516d25e39bbd909cb7185e74a453cc6 (patch)
tree2a3fc4b1c74426f6041987f8c8f92c9f04a4ca7d /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent134be34c844a78f0bb7f6f597417547e7678eee1 (diff)
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 <jrh3@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy29
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy14
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy18
3 files changed, 31 insertions, 30 deletions
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 <class>CreateVcpeResCustService.bpmn</class> 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"))