diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
4 files changed, 54 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java index 376a27e830..4cde9c1fc8 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java @@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks.listeners; import java.util.Collections; import java.util.List; +import java.util.Optional; import org.onap.so.bpmn.common.BBConstants; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.common.listener.db.PostCompletionRequestsDbListener; @@ -55,7 +56,7 @@ public class MultiStageSkipListener implements FlowManipulator, PostCompletionRe @Override public boolean shouldRunFor(BuildingBlockExecution execution) { - return (boolean) execution.getVariable(G_MULTI_STAGE_DESIGN); + return (boolean) Optional.ofNullable(execution.getVariable(G_MULTI_STAGE_DESIGN)).orElse(false); } @Override diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java index 0a825b8424..62d6a110f6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java @@ -39,12 +39,33 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +/** + * This class is used for creating and deleting the request for VfModule. + * + */ @Component public class VnfAdapterVfModuleResources { @Autowired private VnfAdapterVfModuleObjectMapper vnfAdapterVfModuleObjectMapper; + /** + * This method is used for creating the request for the VfModule. + * + * This method take these parameter and call the VnfAdapterVfModuleObjectMapper to create the request. + * + * @param requestContext + * @param cloudRegion + * @param orchestrationContext + * @param serviceInstance + * @param genericVnf + * @param vfModule + * @param volumeGroup + * @param sdncVnfQueryResponse + * @param sdncVfModuleQueryResponse + * @throws IOException & MissingValueTagException + * @return + */ public CreateVfModuleRequest createVfModuleRequest(RequestContext requestContext, CloudRegion cloudRegion, OrchestrationContext orchestrationContext, ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule, VolumeGroup volumeGroup, String sdncVnfQueryResponse, String sdncVfModuleQueryResponse) @@ -54,6 +75,19 @@ public class VnfAdapterVfModuleResources { sdncVfModuleQueryResponse); } + /** + * This method is used for delete the request for the VfModule. + * + * This method take these parameter and call the VnfAdapterVfModuleObjectMapper to delete the request. + * + * @param requestContext + * @param cloudRegion + * @param serviceInstance + * @param genericVnf + * @param vfModule + * @throws IOException + * @return + */ public DeleteVfModuleRequest deleteVfModuleRequest(RequestContext requestContext, CloudRegion cloudRegion, ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule) throws IOException { return vnfAdapterVfModuleObjectMapper.deleteVfModuleRequestMapper(requestContext, cloudRegion, serviceInstance, diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java index bef4ec3465..fd0af3a4dd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java @@ -55,6 +55,22 @@ public class VnfTopologyOperationRequestMapper { @Autowired private GeneralTopologyObjectMapper generalTopologyObjectMapper; + /** + * This method is used for creating the vnf request. + * + * By these parameter it will get he detailas and prepare the request. + * + * @param svcOperation + * @param svcAction + * @param requestAction + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return request + */ public GenericResourceApiVnfOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration requestAction, GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing, diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java index 9e2eac416c..82d610fa97 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java @@ -77,6 +77,8 @@ public class MultiStageSkipListenerTest { execution.setVariable("multiStageDesign", false); assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution)); + execution.setVariable("multiStageDesign", null); + assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution)); } |