Merge "Reorder modifiers"
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / VnfCmBase.groovy
index c588d38..d8405aa 100644 (file)
@@ -28,7 +28,6 @@ import groovy.xml.QName
 import org.json.JSONArray
 import org.json.JSONObject
 
-import java.beans.MetaData.java_lang_Class_PersistenceDelegate
 import java.io.Serializable;
 import java.util.List
 import java.util.UUID;
@@ -43,7 +42,6 @@ import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
 import org.openecomp.mso.bpmn.common.scripts.VidUtils;
 import org.openecomp.mso.bpmn.core.RollbackData
 import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
 import org.openecomp.mso.bpmn.core.json.JsonUtils
 import org.openecomp.mso.bpmn.core.domain.ModelInfo
 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
@@ -279,11 +277,19 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                                }
                        }
                                                
-                       if (cloudRegionId != null) {                    
-                               AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.DEFAULT_CLOUD_REGION, cloudRegionId)                              
+                       if (cloudRegionId != null) {
+                               String cloudOwnerId = "att-aic"; 
+                               try {
+                                   cloudOwnerId = execution.getVariable("URN_mso_default_cloud_owner_id");
+                                   if (cloudOwnerId == null) cloudOwnerId = "att-aic";
+                               } catch (RuntimeException e) {
+                                       cloudOwnerId = "att-aic"; 
+                               }
+                               
+                               AAIUri cloudRegionUri = AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudOwnerId, cloudRegionId)                                
                                // Check if this client region exists
                                if (!client.exists(cloudRegionUri)) {
-                                       logDebug("Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
+                                       logDebug("Cloud Region with cloudOwner ID " + cloudOwnerId + " and cloudRegionId " + cloudRegionId + " does not exist in A&AI", isDebugLogEnabled)
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 404, "Cloud Region with cloudRegionId " + cloudRegionId + " does not exist in A&AI")
                                }