1710 Rebase - Second Attempt
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / DeleteGenericALaCarteServiceInstance.groovy
index 7555885..c3aadaf 100644 (file)
@@ -126,6 +126,27 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                        } else {
                                execution.setVariable("subscriptionServiceType", subscriptionServiceType)
                        }
+                       
+                       /*
+                        * Extracting User Parameters from incoming Request and converting into a Map
+                        */
+                       def jsonSlurper = new JsonSlurper()
+                       def jsonOutput = new JsonOutput()
+
+                       Map reqMap = jsonSlurper.parseText(siRequest)
+
+                       //InputParams
+                       def userParams = reqMap.requestDetails?.requestParameters?.userParams
+
+                       Map<String, String> inputMap = [:]
+                       if (userParams) {
+                               userParams.each {
+                                       userParam -> inputMap.put(userParam.name, userParam.value)
+                               }
+                       }
+                       
+                       utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+                       execution.setVariable("serviceInputParams", inputMap)
 
                } catch (BpmnError e) {
                        throw e;
@@ -171,7 +192,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                        }
 
                        String buildworkflowException =
-                               """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
+                               """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
                                        <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
                                        <aetgt:ErrorCode>7000</aetgt:ErrorCode>
                                   </aetgt:WorkflowException>"""
@@ -193,9 +214,9 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                        String requestId = execution.getVariable("msoRequestId")
                        String source = execution.getVariable("source")
                        String msoCompletionRequest =
-                       """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
-                                                               xmlns:ns="http://org.openecomp/mso/request/types/v1">\r
-                                               <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                       """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+                                                               xmlns:ns="http://org.openecomp/mso/request/types/v1">
+                                               <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
                                                        <request-id>${requestId}</request-id>
                                                        <action>DELETE</action>
                                                        <source>${source}</source>
@@ -228,7 +249,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                        String requestId = execution.getVariable("msoRequestId")
                        String source = execution.getVariable("source")
                        String requestInfo =
-                       """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                       """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
                                        <request-id>${requestId}</request-id>
                                        <action>DELETE</action>
                                        <source>${source}</source>
@@ -241,15 +262,15 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                        String errorException = "  Bpmn error encountered in CreateServiceInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
                        String requestId = execution.getVariable("msoRequestId")
                        String falloutRequest =
-                       """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
-                                                                    xmlns:ns="http://org.openecomp/mso/request/types/v1"\r
-                                                                    xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">\r
-                                          <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">\r
+                       """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+                                                                    xmlns:ns="http://org.openecomp/mso/request/types/v1"
+                                                                    xmlns:wfsch="http://org.openecomp/mso/workflow/schema/v1">
+                                          <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
                                              <request-id>${requestId}</request-id>
                                              <action>DELETE</action>
                                              <source>VID</source>
                                           </request-info>
-                                               <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
+                                               <aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">
                                                        <aetgt:ErrorMessage>${errorException}</aetgt:ErrorMessage>
                                                        <aetgt:ErrorCode>7000</aetgt:ErrorCode>
                                                </aetgt:WorkflowException>
@@ -279,7 +300,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                                        """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                                                <soapenv:Header/>
                                                <soapenv:Body>
-                                                       <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">\r
+                                                       <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
                                                                <requestId>${requestId}</requestId>
                                                                <lastModifiedBy>BPMN</lastModifiedBy>
                                                                <statusMessage>${statusMessage}</statusMessage>
@@ -328,7 +349,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
                                        """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                                                <soapenv:Header/>
                                                <soapenv:Body>
-                                                       <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">\r
+                                                       <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
                                                                <requestId>${requestId}</requestId>
                                                                <lastModifiedBy>BPMN</lastModifiedBy>
                                                                <statusMessage>${statusMessage}</statusMessage>