Merge "ensure default flags are set on execution"
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Fri, 6 Nov 2020 14:38:15 +0000 (14:38 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 6 Nov 2020 14:38:15 +0000 (14:38 +0000)
1  2 
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java

@@@ -178,6 -178,7 +178,7 @@@ public class WorkflowAction 
  
      public void selectExecutionList(DelegateExecution execution) throws Exception {
          try {
+             fillExecutionDefault(execution);
              final String bpmnRequest = (String) execution.getVariable(BBConstants.G_BPMN_REQUEST);
              ServiceInstancesRequest sIRequest =
                      new ObjectMapper().readValue(bpmnRequest, ServiceInstancesRequest.class);
                                              foundVfModuleOrVG = true;
                                          }
  
 -                                        if (vfModuleCustomization.getVfModule() != null
 -                                                && vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null
 -                                                && vfModuleCustomization.getHeatEnvironment() != null) {
 +                                        if ((vfModuleCustomization.getVfModule() != null)
 +                                                && ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null
 +                                                        && vfModuleCustomization.getHeatEnvironment() != null))
 +                                                || (vfModuleCustomization.getVfModule().getModelName() != null
 +                                                        && vfModuleCustomization.getVfModule().getModelName()
 +                                                                .contains("helm"))) {
                                              foundVfModuleOrVG = true;
                                              Resource resource = new Resource(WorkflowType.VFMODULE,
                                                      vfModuleCustomization.getModelCustomizationUUID(), false);
          return generatedResourceId;
      }
  
-     private void fillExecution(DelegateExecution execution, boolean suppressRollback, String resourceId,
-             WorkflowType resourceType) {
+     private void fillExecutionDefault(DelegateExecution execution) {
          execution.setVariable("sentSyncResponse", false);
          execution.setVariable(HOMING, false);
          execution.setVariable("calledHoming", false);
          execution.setVariable(BBConstants.G_ISTOPLEVELFLOW, true);
+     }
+     private void fillExecution(DelegateExecution execution, boolean suppressRollback, String resourceId,
+             WorkflowType resourceType) {
          execution.setVariable("suppressRollback", suppressRollback);
          execution.setVariable("resourceId", resourceId);
          execution.setVariable("resourceType", resourceType);