X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fblueprintsprocessor%2Fmodules%2Fblueprints%2Fblueprint-validation%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fcontrollerblueprints%2Fvalidation%2FBluePrintWorkflowValidatorImpl.kt;fp=ms%2Fblueprintsprocessor%2Fmodules%2Fblueprints%2Fblueprint-validation%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fcontrollerblueprints%2Fvalidation%2FBlueprintWorkflowValidatorImpl.kt;h=21923d1f9c18322a031d952a526d56293bdc9f47;hb=45263f50896a7021cd17d78ce83b29365cb19c29;hp=bff09fc83c8261a674aae76f5fabd508201526b1;hpb=76cb04c2302c9f8f0395f86d8e8d246fdae0fd28;p=ccsdk%2Fcds.git diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintWorkflowValidatorImpl.kt similarity index 79% rename from ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt rename to ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintWorkflowValidatorImpl.kt index bff09fc83..21923d1f9 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BlueprintWorkflowValidatorImpl.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/BluePrintWorkflowValidatorImpl.kt @@ -17,11 +17,11 @@ package org.onap.ccsdk.cds.controllerblueprints.validation -import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeValidatorService -import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowValidator -import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeValidatorService +import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowValidator +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.validation.utils.PropertyAssignmentValidationUtils import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -30,20 +30,20 @@ import org.springframework.stereotype.Service @Service("default-workflow-validator") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class BlueprintWorkflowValidatorImpl(private val bluePrintTypeValidatorService: BlueprintTypeValidatorService) : BlueprintWorkflowValidator { +open class BluePrintWorkflowValidatorImpl(private val bluePrintTypeValidatorService: BluePrintTypeValidatorService) : BluePrintWorkflowValidator { - private val log = LoggerFactory.getLogger(BlueprintServiceTemplateValidatorImpl::class.toString()) - lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*> + private val log = LoggerFactory.getLogger(BluePrintServiceTemplateValidatorImpl::class.toString()) + lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*> var paths: MutableList = arrayListOf() - override fun validate(bluePrintRuntimeService: BlueprintRuntimeService<*>, workflowName: String, workflow: Workflow) { + override fun validate(bluePrintRuntimeService: BluePrintRuntimeService<*>, workflowName: String, workflow: Workflow) { log.info("Validating Workflow($workflowName)") this.bluePrintRuntimeService = bluePrintRuntimeService paths.add(workflowName) - paths.joinToString(BlueprintConstants.PATH_DIVIDER) + paths.joinToString(BluePrintConstants.PATH_DIVIDER) // Validate Workflow Inputs validateInputs(workflow) @@ -55,7 +55,7 @@ open class BlueprintWorkflowValidatorImpl(private val bluePrintTypeValidatorServ paths.add("steps") workflow.steps?.forEach { stepName, step -> paths.add(stepName) - paths.joinToString(BlueprintConstants.PATH_DIVIDER) + paths.joinToString(BluePrintConstants.PATH_DIVIDER) // Validate target step.target?.let { @@ -65,18 +65,18 @@ open class BlueprintWorkflowValidatorImpl(private val bluePrintTypeValidatorServ val nodeTypeDerivedFrom = bluePrintRuntimeService.bluePrintContext().nodeTemplateNodeType(it).derivedFrom check( - nodeTypeDerivedFrom == BlueprintConstants.MODEL_TYPE_NODE_WORKFLOW || - nodeTypeDerivedFrom == BlueprintConstants.MODEL_TYPE_NODE_COMPONENT + nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW || + nodeTypeDerivedFrom == BluePrintConstants.MODEL_TYPE_NODE_COMPONENT ) { "NodeType(${nodeTemplate.type}) derived from is '$nodeTypeDerivedFrom', Expected " + - "'${BlueprintConstants.MODEL_TYPE_NODE_WORKFLOW}' or '${BlueprintConstants.MODEL_TYPE_NODE_COMPONENT}'" + "'${BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW}' or '${BluePrintConstants.MODEL_TYPE_NODE_COMPONENT}'" } } catch (e: Exception) { - bluePrintRuntimeService.getBlueprintError() + bluePrintRuntimeService.getBluePrintError() .addError( "Failed to validate Workflow($workflowName)'s step($stepName)'s " + "definition", - paths.joinToString(BlueprintConstants.PATH_DIVIDER), e.message!!, + paths.joinToString(BluePrintConstants.PATH_DIVIDER), e.message!!, "BlueprintWorkflowValidatorImpl" ) }