diff options
author | SagarS <sagar.shetty@est.tech> | 2022-06-08 12:52:36 +0100 |
---|---|---|
committer | SagarS <sagar.shetty@est.tech> | 2022-06-08 12:52:45 +0100 |
commit | ff9d4779f0089c884add00ddea5a3d0fca0d4778 (patch) | |
tree | 082a7ac301267e29bc198432b9a30dd31ecb8f4c /bpmn | |
parent | cc6009334c69b0856dad1b95755ef560fbeab174 (diff) |
[SO] CNF Updates bpm updates
Change-Id: I3ae0e4b96ce45ebdc7daf13d6666f570e05d95c5
Signed-off-by: SagarS <sagar.shetty@est.tech>
Issue-ID: SO-3905
Diffstat (limited to 'bpmn')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/CnfInstantiateTask.java | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/CnfInstantiateTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/CnfInstantiateTask.java index b6be7716f6..0b24f2608b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/CnfInstantiateTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/CnfInstantiateTask.java @@ -19,22 +19,16 @@ */ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.INPUT_PARAMETER; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParameter; -import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.InputParametersProvider; -import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils.NullInputParameter; -import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; +import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; -import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; +import org.onap.so.serviceinstancebeans.RequestDetails; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; + /** * This class performs CNF Instantiation * @@ -43,48 +37,22 @@ import org.springframework.stereotype.Component; @Component public class CnfInstantiateTask { private static final Logger LOGGER = LoggerFactory.getLogger(CnfInstantiateTask.class); - private final InputParametersProvider<GenericVnf> sdncInputParametersProvider; private final ExtractPojosForBB extractPojosForBB; - private final InputParametersProvider<Map<String, Object>> userParamInputParametersProvider; @Autowired - public CnfInstantiateTask(final InputParametersProvider<GenericVnf> inputParametersProvider, - final InputParametersProvider<Map<String, Object>> userParamInputParametersProvider, - final ExtractPojosForBB extractPojosForBB) { - this.sdncInputParametersProvider = inputParametersProvider; - this.userParamInputParametersProvider = userParamInputParametersProvider; + public CnfInstantiateTask(final ExtractPojosForBB extractPojosForBB) { this.extractPojosForBB = extractPojosForBB; } public void handleCnfInstatiate(final BuildingBlockExecution execution) { try { LOGGER.debug("Executing handleCnfInstatiate ..."); - final InputParameter userParamsInputParameter = getUserParamsInputParameter(execution); + ExecuteBuildingBlock executeBuildingBlock = (ExecuteBuildingBlock) execution.getVariable("buildingBlock"); + RequestDetails requestDetails = executeBuildingBlock.getRequestDetails(); + LOGGER.debug("RequestDetails: {}", requestDetails); LOGGER.debug("Finished executing handleCnfInstatiate ..."); } catch (final Exception exception) { - LOGGER.error("Unable to get input parameters", exception); - execution.setVariable(INPUT_PARAMETER, NullInputParameter.NULL_INSTANCE); - } - } - - private InputParameter getUserParamsInputParameter(final BuildingBlockExecution execution) { - final GeneralBuildingBlock generalBuildingBlock = execution.getGeneralBuildingBlock(); - if (generalBuildingBlock != null && generalBuildingBlock.getRequestContext() != null - && generalBuildingBlock.getRequestContext().getRequestParameters() != null) { - final List<Map<String, Object>> userParams = - generalBuildingBlock.getRequestContext().getRequestParameters().getUserParams(); - if (userParams != null) { - final Map<String, Object> params = new HashMap<>(); - userParams.stream().forEach(obj -> { - params.putAll(obj); - }); - LOGGER.info("User params found : {}", params); - if (userParams != null && !userParams.isEmpty()) { - return userParamInputParametersProvider.getInputParameter(params); - } - } + LOGGER.error("Unable to instantiate CNF", exception); } - LOGGER.warn("No input parameters found in userparams ..."); - return NullInputParameter.NULL_INSTANCE; } } |