summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2020-03-12 08:27:11 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-12 08:27:11 +0000
commit94dc235a63885c80b26f3753f56e7dd520a896a0 (patch)
treec3915b734695caca2995772d5ec87a112b6dd080 /bpmn
parentba18c19740050c9ac7e2b0e1ba457a83160e9003 (diff)
parentbafa097c93d617ee19f7f8d14e35a66178bc92e4 (diff)
Merge "resolve Activation/Deactivation DB data modification problem"
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateCommunicationService.groovy7
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSliceService.groovy18
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy2
3 files changed, 16 insertions, 11 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateCommunicationService.groovy
index dc33bc930a..4ed0ea6a44 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateCommunicationService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateCommunicationService.groovy
@@ -102,6 +102,9 @@ class ActivateCommunicationService extends AbstractServiceTaskProcessor {
String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
execution.setVariable("operationId", operationId)
+ String operationType = execution.getVariable("operationType")
+ execution.setVariable("operationType", operationType.toUpperCase())
+
} catch (BpmnError e) {
throw e
} catch (Exception ex) {
@@ -139,14 +142,14 @@ class ActivateCommunicationService extends AbstractServiceTaskProcessor {
if(si.isPresent()) {
if (si.get().getOrchestrationStatus().toLowerCase() == "activated" &&
- operationType == "deactivation") {
+ operationType.equalsIgnoreCase("deactivation")) {
logger.info("Service is in active state")
execution.setVariable("serviceExpectStatus", "deactivated")
execution.setVariable("isContinue", "true")
execution.setVariable("requestParam", "deactivate")
} else if (si.get().getOrchestrationStatus().toLowerCase() == "deactivated" &&
- operationType == "activation"){
+ operationType.equalsIgnoreCase("activation")){
logger.info("Service is in de-activated state")
execution.setVariable("serviceExpectStatus", "activated")
execution.setVariable("isContinue", "true")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSliceService.groovy
index 5570842149..a8c3ef189e 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSliceService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSliceService.groovy
@@ -95,6 +95,7 @@ class ActivateSliceService extends AbstractServiceTaskProcessor {
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
logger.info(msg)
+ execution.setVariable("globalSubscriberId", "5GCustomer")
} else {
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
@@ -104,14 +105,16 @@ class ActivateSliceService extends AbstractServiceTaskProcessor {
if (isBlank(subscriptionServiceType)) {
msg = "Input subscriptionServiceType is null"
logger.debug(msg)
- //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ execution.setVariable("subscriptionServiceType", "5G")
} else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
}
String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
execution.setVariable("operationId", operationId)
- execution.getVariable("operationType")
+ String operationType = execution.getVariable("operationType")
+ execution.setVariable("operationType", operationType.toUpperCase())
+
logger.info("operationType is " + execution.getVariable("operationType") )
} catch (BpmnError e) {
throw e
@@ -308,7 +311,7 @@ class ActivateSliceService extends AbstractServiceTaskProcessor {
String nssiid = nssi.getNssiId()
updateStratus(execution, globalCustId, serviceType, nssiid, operationType)
}
- if (operationType == "activation") {
+ if (operationType.equalsIgnoreCase("activation")) {
//update the s-nssai
updateStratus(execution, globalCustId, serviceType, e2eserviceInstanceId, operationType)
//update the nsi
@@ -345,7 +348,7 @@ class ActivateSliceService extends AbstractServiceTaskProcessor {
Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
if (si.isPresent()) {
- if (operationType == "activation") {
+ if (operationType.equalsIgnoreCase("activation")) {
if (si.get().getOrchestrationStatus() == "deactivated") {
si.get().setOrchestrationStatus("activated")
client.update(uri, si.get())
@@ -484,15 +487,14 @@ class ActivateSliceService extends AbstractServiceTaskProcessor {
Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
if (si.isPresent()) {
if (si.get().getOrchestrationStatus().toLowerCase() == "activated" &&
- operationType == "deactivation") {
+ operationType.equalsIgnoreCase("deactivation")) {
logger.info("Service is in active state")
execution.setVariable("e2eservicestatus", "activated")
execution.setVariable("isContinue", "true")
String snssai = si.get().getEnvironmentContext()
execution.setVariable("snssai", snssai)
- } else if ((si.get().getOrchestrationStatus().toLowerCase() == "deactivated" ||
- si.get().getOrchestrationStatus().toLowerCase() == "created") &&
- operationType == "activation") {
+ } else if (si.get().getOrchestrationStatus().toLowerCase() == "deactivated" &&
+ operationType.equalsIgnoreCase("activation")) {
logger.info("Service is in de-activated state")
execution.setVariable("e2eservicestatus", "deactivated")
execution.setVariable("isContinue", "true")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy
index e3470cd011..71da2abd05 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy
@@ -54,7 +54,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank
*/
class CreateCommunicationService extends AbstractServiceTaskProcessor {
- String Prefix="CRESI_"
+ String Prefix="CCS_"
ExceptionUtil exceptionUtil = new ExceptionUtil()