summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/main/groovy
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy34
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy26
2 files changed, 24 insertions, 36 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
index 0f50ae6c27..da3ecbaef0 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
@@ -173,12 +173,6 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("DCVFM_serviceInstanceId", serviceInstanceId)
rollbackData.put("VFMODULE", "serviceInstanceId", serviceInstanceId)
msoLogger.debug("serviceInstanceId: " + serviceInstanceId)
- //OofDirectives
- String oofDirectives = execution.getVariable(cloudSiteId + "_oofDirectives")
- if (flavorList != null) {
- execution.setVariable("DCVFM_flavorList", flavorList)
- logDebug("flavorList is: " + flavorList, isDebugLogEnabled)
- }
//source - HARDCODED
def source = "VID"
execution.setVariable("DCVFM_source", source)
@@ -201,7 +195,7 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("DCVFM_asdcServiceModelVersion", asdcServiceModelVersion)
msoLogger.debug("asdcServiceModelVersion: " + asdcServiceModelVersion)
//personaModelId
- execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
+ execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
//personaModelVersion
execution.setVariable("DCVFM_personaModelVersion", jsonUtil.getJsonValue(vfModuleModelInfo, "modelUuid"))
//vfModuleLabel
@@ -227,8 +221,14 @@ public class DoCreateVfModule extends VfModuleBase {
//globalSubscriberId
String globalSubscriberId = execution.getVariable("globalSubscriberId")
execution.setVariable("DCVFM_globalSubscriberId", globalSubscriberId)
- msoLogger.debug("globalSubsrciberId: " + globalSubscriberId)
+ msoLogger.debug("globalSubsrciberId: " + globalSubscriberId)
+ //OofDirectives
+ String oofDirectives = execution.getVariable("oofDirectives")
Map<String,String> vfModuleInputParams = execution.getVariable("vfModuleInputParams")
+ if (oofDirectives != null) {
+ vfModuleInputParams.put("oofDirectives", oofDirectives)
+ logDebug("OofDirectives are: " + oofDirectives, isDebugLogEnabled)
+ }
if (vfModuleInputParams != null) {
execution.setVariable("DCVFM_vnfParamsMap", vfModuleInputParams)
execution.setVariable("DCVFM_vnfParamsExistFlag", true)
@@ -452,8 +452,18 @@ public class DoCreateVfModule extends VfModuleBase {
}
execution.setVariable("DCVFM_vnfParamsMap", paramsMap)
}
+
+ //OofDirectives
+ String oofDirectives = execution.getVariable("oofDirectives")
+ if (oofDirectives != null) {
+ Map<String, String> paramsMap = execution.getVariable("DCVFM_vnfParamsMap")
+ paramsMap.put("oofDirectives", oofDirectives)
+ logDebug("OofDirectives are: " + oofDirectives, isDebugLogEnabled)
+ execution.setVariable("DCVFM_vnfParamsMap", paramsMap)
+ }
}
+
//Get or Generate UUID
String uuid = execution.getVariable("DCVFM_uuid")
if(uuid == null){
@@ -502,8 +512,10 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("rollbackData", rollbackData)
}catch(BpmnError b){
+ msoLogger.error(b);
throw b
}catch(Exception e){
+ msoLogger.error(e);
exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error encountered in PreProcess method!")
}
@@ -920,8 +932,6 @@ public class DoCreateVfModule extends VfModuleBase {
def serviceId = execution.getVariable("DCVFM_serviceId")
//serviceInstanceId
def serviceInstanceId = execution.getVariable("DCVFM_serviceInstanceId")
- //OofDirectives
- String oofDirectives = execution.getVariable("DCVFM_oofDirectives")
//backoutOnFailure
def backoutOnFailure = execution.getVariable("DCVFM_backoutOnFailure")
//volumeGroupId
@@ -957,10 +967,6 @@ public class DoCreateVfModule extends VfModuleBase {
}
Map<String, String> vnfParamsMap = execution.getVariable("DCVFM_vnfParamsMap")
- // Add flavorLabel List to vnfParamsMap
- flavorList.each { cloudFlavor ->
- vnfParamsMap.put("label_" + cloudFlavor.getFlavorLabel(), cloudFlavor.getFlavor())
- }
String vfModuleParams = ""
//Get SDNC Response Data for VF Module Topology
String vfModuleSdncGetResponse = execution.getVariable('DCVFM_getSDNCAdapterResponse')
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index dd135f3af5..c5f712cafc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -21,7 +21,6 @@ package org.onap.so.bpmn.vcpe.scripts;
import static org.apache.commons.lang3.StringUtils.*
-import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
@@ -32,6 +31,7 @@ import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.domain.*
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
import org.springframework.web.util.UriUtils;
@@ -61,7 +61,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the <class>CreateServiceInstance.bpmn</class> process.
* @param execution
*/
- public InitializeProcessVariables(DelegateExecution execution) {
+ private InitializeProcessVariables(DelegateExecution execution) {
/* Initialize all the process variables in this block */
execution.setVariable("createVcpeServiceRequest", "")
@@ -99,9 +99,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
InitializeProcessVariables(execution)
//Config Inputs
- String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')
+ String aaiDistDelay = UrnPropertiesReader.getVariable("aai.workflowAaiDistributionDelay")
if (isBlank(aaiDistDelay)) {
- msg = "URN_mso_workflow_aai_distribution_delay is null"
+ String msg = "workflowAaiDistributionDelay is null"
msoLogger.debug(msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
@@ -191,7 +191,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
* Extracting User Parameters from incoming Request and converting into a Map
*/
def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)
@@ -270,7 +269,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void sendSyncResponse(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("Inside sendSyncResponse of CreateVcpeResCustService ")
@@ -296,7 +294,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
//
// *******************************
public void prepareDecomposeService(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside prepareDecomposeService of CreateVcpeResCustService ")
@@ -319,7 +316,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
//
// *******************************
public void prepareCreateServiceInstance(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside prepareCreateServiceInstance of CreateVcpeResCustService ")
@@ -351,7 +347,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void postProcessServiceInstanceCreate(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessServiceInstanceCreate(' + 'execution=' + execution.getId() + ')'
- def isDebugLogEnabled = execution.getVariable(DebugFlag)
msoLogger.trace('Entered ' + method)
String requestId = execution.getVariable("mso-request-id")
@@ -387,7 +382,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void processDecomposition(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("Inside processDecomposition() of CreateVcpeResCustService ")
@@ -450,7 +444,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void prepareCreateAllottedResourceTXC(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ")
@@ -461,7 +454,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
* ModelInfo modelInfo = serviceDecomposition.getModelInfo()
*
*/
- String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
//allottedResourceModelInfo
@@ -504,7 +496,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void prepareCreateAllottedResourceBRG(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ")
@@ -515,7 +506,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
* ModelInfo modelInfo = serviceDecomposition.getModelInfo()
*
*/
- String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
//allottedResourceModelInfo
@@ -561,7 +551,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// Generate Network request Section
// *******************************
public void prepareVnfAndModulesCreate(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ")
@@ -630,7 +619,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// Validate Vnf request Section -> increment count
// *******************************
public void validateVnfCreate(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
try {
msoLogger.trace("Inside validateVnfCreate of CreateVcpeResCustService ")
@@ -652,7 +640,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
// Prepare Completion request Section
// *****************************************
public void postProcessResponse(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("Inside postProcessResponse of CreateVcpeResCustService ")
@@ -691,7 +678,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void preProcessRollback(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("preProcessRollback of CreateVcpeResCustService ")
try {
@@ -712,7 +698,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void postProcessRollback(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("postProcessRollback of CreateVcpeResCustService ")
String msg = ""
try {
@@ -732,7 +717,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void prepareFalloutRequest(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
msoLogger.trace("STARTED CreateVcpeResCustService prepareFalloutRequest Process ")
@@ -764,7 +748,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
public void sendSyncError(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
execution.setVariable("prefix", Prefix)
msoLogger.trace("Inside sendSyncError() of CreateVcpeResCustService ")
@@ -792,7 +775,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
}
public void processJavaException(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
execution.setVariable("prefix", Prefix)
try {
msoLogger.debug("Caught a Java Exception")