diff options
author | KAPIL SINGAL <ks220y@att.com> | 2020-08-04 18:47:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-04 18:47:13 +0000 |
commit | b122cc004acabde810a8345709b98039448e403c (patch) | |
tree | f96a090de84115a4402f48c81b337327ecf4f4e2 /ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin | |
parent | 3f5717ec9eda093c3269945e6048f8491c03f97a (diff) | |
parent | aff838d94718e09d2f0cffec52d8ae5cc80c89ed (diff) |
Merge "Fix incorrect error handling for resolveWorkflowOutputs" into frankfurt6.0.1-ONAP
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin')
-rw-r--r-- | ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt index 8a699d8d2..240348081 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt @@ -90,12 +90,22 @@ open class BluePrintWorkflowExecutionServiceImpl( } executionServiceOutput.commonHeader = executionServiceInput.commonHeader executionServiceOutput.actionIdentifiers = executionServiceInput.actionIdentifiers + // Resolve Workflow Outputs - val workflowOutputs = bluePrintRuntimeService.resolveWorkflowOutputs(workflowName) + var workflowOutputs: MutableMap<String, JsonNode>? = null + try { + workflowOutputs = bluePrintRuntimeService.resolveWorkflowOutputs(workflowName) + } catch (e: RuntimeException) { + log.error("Failed to resolve outputs for workflow: $workflowName", e) + e.message?.let { bluePrintRuntimeService.getBluePrintError().errors.add(it) } + } // Set the Response Payload executionServiceOutput.payload = JacksonUtils.objectMapper.createObjectNode() - executionServiceOutput.payload.set<JsonNode>("$workflowName-response", workflowOutputs.asObjectNode()) + executionServiceOutput.payload.set<JsonNode>( + "$workflowName-response", + workflowOutputs?.asObjectNode() ?: JacksonUtils.objectMapper.createObjectNode() + ) return executionServiceOutput } } |