Add homing flag to alacart flows 33/68233/2
authorMarcus G K Williams <marcus.williams@intel.com>
Wed, 19 Sep 2018 22:41:58 +0000 (15:41 -0700)
committerMarcus G K Williams <marcus.williams@intel.com>
Thu, 20 Sep 2018 20:41:20 +0000 (13:41 -0700)
Issue-ID: SO-745
Change-Id: I5e9e5031be403d17e0dc141a0879b0a28062168e
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java

index 86c5f65..dd135f3 100644 (file)
@@ -232,6 +232,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
                         }
                         if ("Homing_Solution".equals(userParam?.name)) {
                                     execution.setVariable("homingService", userParam.value)
+                                    execution.setVariable("callHoming", true)
                                     inputMap.put("Homing_Solution", userParam.value)
                                 }
                 }
index 02459d7..2d5638c 100644 (file)
@@ -103,6 +103,7 @@ public class WorkflowAction {
        private static final String CREATEINSTANCE = "createInstance";
        private static final String USERPARAMSERVICE = "service";
        private static final String supportedTypes = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances";
+       private static final String HOMINGSOLUTION = "Homing_Solution";
        private static final Logger logger = LoggerFactory.getLogger(WorkflowAction.class);
        
        @Autowired
@@ -160,6 +161,18 @@ public class WorkflowAction {
                        execution.setVariable("resourceId", resourceId);
                        execution.setVariable("resourceType", resourceType);
 
+                       if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) {
+                               List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters()
+                                               .getUserParams();
+                               for (Map<String, Object> params : userParams) {
+                                       if (params.containsKey(HOMINGSOLUTION)) {
+                                               execution.setVariable("homing", true);
+                                               execution.setVariable("callHoming", true);
+                                               execution.setVariable("homingSolution", params.get(HOMINGSOLUTION));
+                                       }
+                               }
+                       }
+
                        if (aLaCarte) {
                                if (orchFlows == null || orchFlows.isEmpty()) {
                                        orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte);