Merge "Add the query to AAI for SI with customer info"
authorRob Daugherty <rd472p@att.com>
Thu, 13 Dec 2018 15:18:38 +0000 (15:18 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 13 Dec 2018 15:18:38 +0000 (15:18 +0000)
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java

index 0017c4e..63f832d 100644 (file)
@@ -1301,7 +1301,12 @@ public class BBInputSetup implements JavaDelegate {
                                        .getAAIServiceInstanceByName(requestDetails.getRequestInfo().getInstanceName(), customer);
                        }
                        if (serviceInstanceId != null && serviceInstanceAAI == null) {
-                               serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId);
+                               if(customer != null && customer.getServiceSubscription() != null) {
+                                       serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceByIdAndCustomer(customer.getGlobalCustomerId(), 
+                                                       customer.getServiceSubscription().getServiceType(), serviceInstanceId);
+                               } else {
+                                       serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId);
+                               }
                        }
                        if (serviceInstanceAAI != null) {
                                lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstanceId);