Add output enrichment validation
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / kotlin / org / onap / ccsdk / cds / controllerblueprints / service / enhancer / BluePrintWorkflowEnhancerImpl.kt
index 091dfda..8379e50 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,11 +67,16 @@ open class BluePrintWorkflowEnhancerImpl(private val bluePrintRepoService: BlueP
         // Clean Dynamic Property Field, If present
         workflow.inputs?.remove(dynamicPropertyName)
 
+        // Enrich Workflow Inputs
+        enhanceWorkflowInputs(name, workflow)
+
+        // Enrich Workflow Outputs
+        enhanceWorkflowOutputs(name, workflow)
+
         // Enrich Only for Resource Assignment and Dynamic Input Properties if any
         enhanceStepTargets(name, workflow)
 
-        // Enrich Workflow Inputs
-        enhanceWorkflowInputs(name, workflow)
+
     }
 
     open fun enhanceWorkflowInputs(name: String, workflow: Workflow) {
@@ -80,6 +86,12 @@ open class BluePrintWorkflowEnhancerImpl(private val bluePrintRepoService: BlueP
         }
     }
 
+    open fun enhanceWorkflowOutputs(name: String, workflow: Workflow) {
+        workflow.outputs?.let { outputs ->
+            bluePrintTypeEnhancerService.enhancePropertyDefinitions(bluePrintRuntimeService, outputs)
+        }
+    }
+
     private fun enhanceStepTargets(name: String, workflow: Workflow) {
 
         // Get the first Step Target NodeTemplate name( It may be Component or DG Node Template)