Merge "Reorder modifiers"
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / DoCreateE2EServiceInstance.groovy
index 4ad58fb..eaec39b 100644 (file)
@@ -46,6 +46,7 @@ import org.openecomp.mso.bpmn.core.WorkflowException
 import org.openecomp.mso.rest.APIResponse;
 import org.openecomp.mso.rest.RESTClient
 import org.openecomp.mso.rest.RESTConfig
+import org.openecomp.mso.bpmn.infrastructure.workflow.service.ServicePluginFactory
 
 import java.util.List;
 import java.util.UUID;
@@ -137,8 +138,8 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        String uuiRequest = execution.getVariable("uuiRequest")
-                       String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceDefId")
-                       String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.templateId")
+                       String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
+                       String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
                        String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
                        execution.setVariable("serviceModelName", serviceModelName)
                        //aai serviceType and Role can be setted as fixed value now.
@@ -189,7 +190,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
 
         try {
-            utils.log("DEBUG", " ***** Inside prepareDecomposeService of create generic e2e service ***** ", isDebugEnabled)
+            utils.log("INFO", " ***** Inside prepareDecomposeService of create generic e2e service ***** ", isDebugEnabled)
             String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
             String modelUuid = execution.getVariable("modelUuid")
             //here modelVersion is not set, we use modelUuid to decompose the service.
@@ -211,18 +212,30 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
     public void processDecomposition(DelegateExecution execution) {
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
     
-        utils.log("DEBUG", " ***** Inside processDecomposition() of  create generic e2e service flow ***** ", isDebugEnabled)    
+        utils.log("INFO", " ***** Inside processDecomposition() of  create generic e2e service flow ***** ", isDebugEnabled)
         try {
             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
         } catch (Exception ex) {
             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. processDecomposition() - " + ex.getMessage()
-            utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+            utils.log("INFO", exceptionMessage, isDebugEnabled)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
         }
     }
     
+    public void doServicePreOperation(DelegateExecution execution){
+       //we need a service plugin platform here. 
+       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+       String uuiRequest = execution.getVariable("uuiRequest")         
+       String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest);
+       execution.setVariable("uuiRequest", newUuiRequest)      
+    }
+    
     public void doServiceHoming(DelegateExecution execution) {
-        //Now Homing is not clear. So to be implemented.
+       //we need a service plugin platform here. 
+       ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+       String uuiRequest = execution.getVariable("uuiRequest")         
+       String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest);
+       execution.setVariable("uuiRequest", newUuiRequest)      
     }
     
        public void postProcessAAIGET(DelegateExecution execution) {