diff options
author | 2020-06-30 06:59:43 -0400 | |
---|---|---|
committer | 2020-06-30 07:43:54 -0400 | |
commit | 181c470b61fae79acb05aedae67a0ceb486f1ee5 (patch) | |
tree | f594f8f23181335f887a632646db0ddb5439ce59 /ms/blueprintsprocessor/modules/services/workflow-service/src/main | |
parent | 34791d15a234063468d6bb358357f290b7d0fd7b (diff) |
Fix incorrect error handling for resolveWorkflowOutputs
Issue-ID: CCSDK-2504
Change-Id: Ie910e47bb97be2db4f4a4e94653e5ae474a78c0d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/workflow-service/src/main')
-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 } } |