aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor
diff options
context:
space:
mode:
authorjananib <janani.b@huawei.com>2020-04-16 03:52:31 +0530
committerDan Timoney <dtimoney@att.com>2020-04-16 15:54:00 +0000
commit1b8d78599d5919825fca2cb314ec28a7573b3a67 (patch)
tree4fd26b05f4175560f5e5ff4433ea20a7008ff803 /ms/blueprintsprocessor
parent5f21c169bbeae55797a61238208290a763b3f86b (diff)
Workflow-spec returning error response
Fix workflow-spec query Change-Id: Ic66e2249b73c113cd25bd99c9cf33984520e31df Issue-ID: CCSDK-2181 Signed-off-by: jananib <janani.b@huawei.com> (cherry picked from commit 7247588ed2ac6b9fb0bd615525ae9347145b66b0)
Diffstat (limited to 'ms/blueprintsprocessor')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt27
1 files changed, 21 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
index f55fee04b..48ca912da 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
@@ -42,6 +42,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.normalizedFile
import org.onap.ccsdk.cds.controllerblueprints.core.deleteNBDir
import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
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.interfaces.BluePrintCatalogService
import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintEnhancerService
import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintCompileCache
@@ -121,17 +122,29 @@ open class BluePrintModelHandler(
workFlowData.inputs = workFlow.inputs
workFlowData.outputs = workFlow.outputs
- for ((k, v) in workFlow.inputs!!) {
- addDataType(v.type, blueprintContext, wfRes)
+ if (workFlow.inputs != null) {
+ for ((k, v) in workFlow.inputs!!) {
+ addPropertyInfo(v, blueprintContext, wfRes)
+ }
}
- for ((k, v) in workFlow.outputs!!) {
- addDataType(v.type, blueprintContext, wfRes)
+ if (workFlow.outputs != null) {
+ for ((k, v) in workFlow.outputs!!) {
+ addPropertyInfo(v, blueprintContext, wfRes)
+ }
}
+
wfRes.workFlowData = workFlowData
return wfRes
}
+ private fun addPropertyInfo(prop: PropertyDefinition, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
+ addDataType(prop.type, ctx, res)
+ if (prop.entrySchema != null && prop.entrySchema!!.type != null) {
+ addDataType(prop.entrySchema!!.type, ctx, res)
+ }
+ }
+
private fun addDataType(name: String, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
var data = ctx.dataTypeByName(name)
if (data != null) {
@@ -141,8 +154,10 @@ open class BluePrintModelHandler(
}
private fun addParentDataType(data: DataType, ctx: BluePrintContext, res: WorkFlowSpecResponse) {
- for ((k, v) in data.properties!!) {
- addDataType(v.type, ctx, res)
+ if (data.properties != null) {
+ for ((k, v) in data.properties!!) {
+ addPropertyInfo(v, ctx, res)
+ }
}
}