Bugfixes for December 2018
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / bpmn / infrastructure / workflow / tasks / WorkflowAction.java
index ac31bc7..10ee13e 100644 (file)
@@ -145,7 +145,7 @@ public class WorkflowAction {
                final String apiVersion = (String) execution.getVariable(G_APIVERSION);
                final String uri = (String) execution.getVariable(G_URI);
                final String vnfType = (String) execution.getVariable(VNF_TYPE);
-               final String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
+               String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
                List<OrchestrationFlow> orchFlows = (List<OrchestrationFlow>) execution.getVariable(G_ORCHESTRATION_FLOW);
                List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
                WorkflowResourceIds workflowResourceIds = populateResourceIdsFromApiHandler(execution);
@@ -166,6 +166,13 @@ public class WorkflowAction {
                        } catch (Exception ex) {
                                cloudOwner = environment.getProperty(defaultCloudOwner);
                        }
+                       boolean suppressRollback = false;
+                       try{
+                               suppressRollback = requestDetails.getRequestInfo().getSuppressRollback();
+                       } catch (Exception ex) {
+                               suppressRollback = false;
+                       }
+                       execution.setVariable("suppressRollback", suppressRollback);
                        Resource resource = extractResourceIdAndTypeFromUri(uri);
                        WorkflowType resourceType = resource.getResourceType();
                        execution.setVariable("resourceName", resourceType.toString());
@@ -177,6 +184,9 @@ public class WorkflowAction {
                        } else {
                                resourceId = resource.getResourceId();
                        }
+                       if((serviceInstanceId == null || serviceInstanceId.equals("")) && resourceType == WorkflowType.SERVICE){
+                               serviceInstanceId = resourceId;
+                       }
                        execution.setVariable("resourceId", resourceId);
                        execution.setVariable("resourceType", resourceType);
 
@@ -398,6 +408,7 @@ public class WorkflowAction {
                        if(virtualLinkKey != null && ebb.getBuildingBlock().getIsVirtualLink() 
                                        && virtualLinkKey.equalsIgnoreCase(ebb.getBuildingBlock().getVirtualLinkKey())) {
                                WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+                               workflowResourceIds.setServiceInstanceId(serviceInstanceId);
                                workflowResourceIds.setNetworkId(resourceId);
                                ebb.setWorkflowResourceIds(workflowResourceIds);
                        }