X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fblueprintsprocessor%2Fmodules%2Fservices%2Fworkflow-service%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fcds%2Fblueprintsprocessor%2Fservices%2Fworkflow%2FBluePrintWorkflowExecutionServiceImpl.kt;h=b1861742297c120d0a44ff939d48f237b5ab7daa;hb=0dfd513f0210324d8a2c4295b8c6c4746298086f;hp=fbd9f4c8b08803e10ce7b9b46ba2675864d580c9;hpb=c90edac236dffb7c495e266dd04991de7e8f04b7;p=ccsdk%2Fcds.git diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt index fbd9f4c8b..b18617422 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/main/kotlin/org/onap/cds/blueprintsprocessor/services/workflow/BluePrintWorkflowExecutionServiceImpl.kt @@ -20,8 +20,10 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.asObjectNode import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory import org.springframework.stereotype.Service @@ -41,6 +43,10 @@ open class BluePrintWorkflowExecutionServiceImpl( val workflowName = executionServiceInput.actionIdentifiers.actionName + // Assign Workflow inputs + val input = executionServiceInput.payload.get("$workflowName-request") + bluePrintRuntimeService.assignWorkflowInputs(workflowName, input) + // Get the DG Node Template val nodeTemplateName = bluePrintContext.workflowFirstStepNodeTemplate(workflowName) @@ -53,7 +59,7 @@ open class BluePrintWorkflowExecutionServiceImpl( componentWorkflowExecutionService .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) } - derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_DG, true) -> { + derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> { dgWorkflowExecutionService .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, properties) } @@ -65,7 +71,12 @@ open class BluePrintWorkflowExecutionServiceImpl( executionServiceOutput.commonHeader = executionServiceInput.commonHeader executionServiceOutput.actionIdentifiers = executionServiceInput.actionIdentifiers - // TODO("Populate Response Payload and status") + // Resolve Workflow Outputs + val workflowOutputs = bluePrintRuntimeService.resolveWorkflowOutputs(workflowName) + + // Set the Response Payload + executionServiceOutput.payload = JacksonUtils.objectMapper.createObjectNode() + executionServiceOutput.payload.set("$workflowName-response", workflowOutputs.asObjectNode()) return executionServiceOutput }