Merge "Reorder modifiers"
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / vcpe / scripts / DoCreateAllottedResourceBRG.groovy
index 54e23a9..f04b738 100644 (file)
@@ -28,7 +28,7 @@ import org.openecomp.mso.rest.APIResponse
 
 import java.util.UUID;
 import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.apache.commons.lang3.*
 import org.springframework.web.util.UriUtils;
 import static org.apache.commons.lang3.StringUtils.*
@@ -45,6 +45,8 @@ import static org.apache.commons.lang3.StringUtils.*
  * @param - disableRollback
  * @param - failExists  - O
  * @param - serviceInstanceId
+ * @param - globalCustomerId - O
+ * @param - subscriptionServiceType - O
  * @param - parentServiceInstanceId
  * @param - allottedReourceId - O
  * @param - allottedResourceModelInfo
@@ -70,7 +72,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
        ExceptionUtil exceptionUtil = new ExceptionUtil()
        JsonUtils jsonUtil = new JsonUtils()
 
-       public void preProcessRequest (Execution execution) {
+       public void preProcessRequest (DelegateExecution execution) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                String msg = ""
@@ -150,7 +152,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," ***** Exit preProcessRequest *****",  isDebugEnabled)
        }
 
-       public void getAaiAR (Execution execution) {
+       public void getAaiAR (DelegateExecution execution) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                utils.log("DEBUG"," ***** getAaiAR ***** ", isDebugEnabled)
@@ -188,7 +190,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *****Exit getAaiAR *****", isDebugEnabled)
        }
 
-       public void createAaiAR(Execution execution) {
+       public void createAaiAR(DelegateExecution execution) {
 
                def isDebugEnabled=execution.getVariable(DebugFlag)
                utils.log("DEBUG"," ***** createAaiAR ***** ", isDebugEnabled)
@@ -310,7 +312,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *** Exit createAaiAR*** ", isDebugEnabled)
        }
 
-       public String buildSDNCRequest(Execution execution, String action, String sdncRequestId) {
+       public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                String msg = ""
@@ -321,6 +323,8 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
 
                        String allottedResourceId = execution.getVariable("allottedResourceId")
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       String globalCustomerId = execution.getVariable("globalCustomerId")
+                       String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
                        String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
                        String callbackUrl = execution.getVariable("sdncCallbackUrl")
                        String requestId = execution.getVariable("msoRequestId")
@@ -374,11 +378,11 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                                        </request-information>
                                        <service-information>
                                                <service-id></service-id>
-                                               <subscription-service-type></subscription-service-type>
+                                               <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
                                                <onap-model-information></onap-model-information>
-                                               <service-instance-id>${parentServiceInstanceId}</service-instance-id>
+                                               <service-instance-id>${serviceInstanceId}</service-instance-id>
                                                <subscriber-name/>
-                                               <global-customer-id></global-customer-id>
+                                               <global-customer-id>${globalCustomerId}</global-customer-id>
                                        </service-information>
                                        <allotted-resource-information>
                                                <allotted-resource-id>${allottedResourceId}</allotted-resource-id>    
@@ -412,7 +416,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                return sdncReq
        }
 
-       public void preProcessSDNCAssign(Execution execution) {
+       public void preProcessSDNCAssign(DelegateExecution execution) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                String msg = ""
@@ -442,7 +446,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *****Exit preProcessSDNCAssign *****", isDebugEnabled)
        }
 
-       public void preProcessSDNCCreate(Execution execution) {
+       public void preProcessSDNCCreate(DelegateExecution execution) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                String msg = ""
@@ -472,7 +476,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *****Exit preProcessSDNCCreate *****", isDebugEnabled)
        }
 
-       public void preProcessSDNCActivate(Execution execution) {
+       public void preProcessSDNCActivate(DelegateExecution execution) {
 
                def isDebugEnabled = execution.getVariable(DebugFlag)
                String msg = ""
@@ -502,7 +506,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *****Exit preProcessSDNCActivate *****", isDebugEnabled)
        }
 
-       public void validateSDNCResp(Execution execution, String response, String method){
+       public void validateSDNCResp(DelegateExecution execution, String response, String method){
 
                def isDebugLogEnabled=execution.getVariable(DebugFlag)
                utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -542,7 +546,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled)
        }
 
-       public void preProcessSDNCGet(Execution execution){
+       public void preProcessSDNCGet(DelegateExecution execution){
                def isDebugLogEnabled = execution.getVariable(DebugFlag)
                utils.log("DEBUG", "*** preProcessSDNCGet *** ", isDebugLogEnabled)
                try{
@@ -571,7 +575,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
 
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")
                        String sdncRequestId = UUID.randomUUID().toString()
-
+                       
                        //neeed the same url as used by vfmodules
                        String SDNCGetRequest =
                        """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
@@ -597,7 +601,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG", "*** Exit preProcessSDNCGet *** ", isDebugLogEnabled)
        }
        
-       public void updateAaiAROrchStatus(Execution execution, String status){
+       public void updateAaiAROrchStatus(DelegateExecution execution, String status){
                def isDebugEnabled = execution.getVariable(DebugFlag)
                utils.log("DEBUG", " *** updateAaiAROrchStatus *** ", isDebugEnabled)
                String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create
@@ -606,7 +610,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG", " *** Exit updateAaiAROrchStatus *** ", isDebugEnabled)
        }
        
-       public void generateOutputs(Execution execution)
+       public void generateOutputs(DelegateExecution execution)
        {
                def isDebugEnabled=execution.getVariable(DebugFlag)
                utils.log("DEBUG"," ***** generateOutputs ***** ", isDebugEnabled)
@@ -629,7 +633,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                
        }
 
-       public void preProcessRollback (Execution execution) {
+       public void preProcessRollback (DelegateExecution execution) {
                def isDebugEnabled=execution.getVariable(DebugFlag)
                utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
                try {
@@ -650,7 +654,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{
                utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
        }
 
-       public void postProcessRollback (Execution execution) {
+       public void postProcessRollback (DelegateExecution execution) {
                def isDebugEnabled=execution.getVariable(DebugFlag)
                utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
                String msg = ""