summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds
diff options
context:
space:
mode:
authorjananib <janani.b@huawei.com>2020-04-16 03:52:31 +0530
committerjananib <janani.b@huawei.com>2020-04-16 04:30:30 +0530
commit7247588ed2ac6b9fb0bd615525ae9347145b66b0 (patch)
tree7ee5aba9a439d7a744080423110cabd6f9ef2730 /ms/blueprintsprocessor/modules/inbounds
parent3a27f2fee05ef874181ea818f28329c2567e52c5 (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>
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds')
-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)
+ }
}
}