Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / inbounds / designer-api / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / designer / api / enhancer / BluePrintWorkflowEnhancerImpl.kt
 
 package org.onap.ccsdk.cds.blueprintsprocessor.designer.api.enhancer
 
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintException
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
 import org.onap.ccsdk.cds.controllerblueprints.core.data.DataType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition
 import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintRepoService
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintTypeEnhancerService
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowEnhancer
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintRepoService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintTypeEnhancerService
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowEnhancer
 import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
 import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
 import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
 import org.springframework.beans.factory.config.ConfigurableBeanFactory
@@ -38,14 +38,14 @@ import org.springframework.stereotype.Service
 
 @Service
 @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-open class BlueprintWorkflowEnhancerImpl(
-    private val bluePrintRepoService: BlueprintRepoService,
-    private val bluePrintTypeEnhancerService: BlueprintTypeEnhancerService,
+open class BluePrintWorkflowEnhancerImpl(
+    private val bluePrintRepoService: BluePrintRepoService,
+    private val bluePrintTypeEnhancerService: BluePrintTypeEnhancerService,
     private val resourceAssignmentEnhancerService: ResourceAssignmentEnhancerService
 ) :
-    BlueprintWorkflowEnhancer {
+    BluePrintWorkflowEnhancer {
 
-    private val log = logger(BlueprintWorkflowEnhancerImpl::class)
+    private val log = logger(BluePrintWorkflowEnhancerImpl::class)
 
     companion object {
 
@@ -53,12 +53,12 @@ open class BlueprintWorkflowEnhancerImpl(
         const val PROPERTY_DEPENDENCY_NODE_TEMPLATES = "dependency-node-templates"
     }
 
-    lateinit var bluePrintRuntimeService: BlueprintRuntimeService<*>
-    lateinit var bluePrintContext: BlueprintContext
+    lateinit var bluePrintRuntimeService: BluePrintRuntimeService<*>
+    lateinit var bluePrintContext: BluePrintContext
 
     private val workflowDataTypes: MutableMap<String, DataType> = hashMapOf()
 
-    override fun enhance(bluePrintRuntimeService: BlueprintRuntimeService<*>, name: String, workflow: Workflow) {
+    override fun enhance(bluePrintRuntimeService: BluePrintRuntimeService<*>, name: String, workflow: Workflow) {
         log.info("##### Enhancing Workflow($name)")
         this.bluePrintRuntimeService = bluePrintRuntimeService
         this.bluePrintContext = bluePrintRuntimeService.bluePrintContext()
@@ -101,14 +101,14 @@ open class BlueprintWorkflowEnhancerImpl(
         val derivedFrom = bluePrintContext.nodeTemplateNodeType(firstNodeTemplateName).derivedFrom
 
         when {
-            derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> {
+            derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> {
                 enhanceStepTargets(name, workflow, firstNodeTemplateName, false)
             }
-            derivedFrom.startsWith(BlueprintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
+            derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> {
                 enhanceStepTargets(name, workflow, firstNodeTemplateName, true)
             }
             else -> {
-                throw BlueprintProcessorException(
+                throw BluePrintProcessorException(
                     "couldn't execute workflow($name) step mapped " +
                         "to node template($firstNodeTemplateName) derived from($derivedFrom)"
                 )
@@ -124,7 +124,7 @@ open class BlueprintWorkflowEnhancerImpl(
 
             // Get the Dependent Component Node Template Names
             val dependencyNodeTemplateNodes = dgNodeTemplate.properties?.get(PROPERTY_DEPENDENCY_NODE_TEMPLATES)
-                ?: throw BlueprintException("couldn't get property($PROPERTY_DEPENDENCY_NODE_TEMPLATES) ")
+                ?: throw BluePrintException("couldn't get property($PROPERTY_DEPENDENCY_NODE_TEMPLATES) ")
 
             dependencyNodeTemplates =
                 JacksonUtils.getListFromJsonNode(dependencyNodeTemplateNodes, String::class.java)
@@ -175,7 +175,7 @@ open class BlueprintWorkflowEnhancerImpl(
 
         val resourceAssignments: MutableList<ResourceAssignment> = JacksonUtils.getListFromFile(filePath, ResourceAssignment::class.java)
             as? MutableList<ResourceAssignment>
-            ?: throw BlueprintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)")
+            ?: throw BluePrintProcessorException("couldn't get ResourceAssignment definitions for the file($filePath)")
 
         val alreadyEnhancedKey = "enhanced-$fileName"
         val alreadyEnhanced = bluePrintRuntimeService.check(alreadyEnhancedKey)
@@ -184,7 +184,7 @@ open class BlueprintWorkflowEnhancerImpl(
 
         if (!alreadyEnhanced) {
             // Call Resource Assignment Enhancer
-            resourceAssignmentEnhancerService.enhanceBlueprint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments)
+            resourceAssignmentEnhancerService.enhanceBluePrint(bluePrintTypeEnhancerService, bluePrintRuntimeService, resourceAssignments)
             bluePrintRuntimeService.put(alreadyEnhancedKey, true.asJsonPrimitive())
         }
 
@@ -215,7 +215,7 @@ open class BlueprintWorkflowEnhancerImpl(
             dynamicDataType = DataType()
             dynamicDataType.version = "1.0.0"
             dynamicDataType.description = "Dynamic DataType definition for workflow($workflowName)."
-            dynamicDataType.derivedFrom = BlueprintConstants.MODEL_TYPE_DATA_TYPE_DYNAMIC
+            dynamicDataType.derivedFrom = BluePrintConstants.MODEL_TYPE_DATA_TYPE_DYNAMIC
 
             val dataTypeProperties: MutableMap<String, PropertyDefinition> = hashMapOf()
             dynamicDataType.properties = dataTypeProperties