diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java index 3c40003dd0..6f6d2972d1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java @@ -757,12 +757,16 @@ public class ServiceInstances { // } // TODO need to make this a configurable property - String defaultServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT"; + String defaultServiceModelName = "*"; + String defaultSourceServiceModelName = msoRequest.getRequestInfo().getSource() + "_DEFAULT"; Service serviceRecord; ModelInfo modelInfo = msoRequest.getModelInfo(); if(msoRequest.getALaCarteFlag()){ - serviceRecord = db.getServiceByModelName(defaultServiceModelName); + serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName); + if (serviceRecord == null) { + serviceRecord = db.getServiceByModelName(defaultServiceModelName); + } }else{ serviceRecord = db.getServiceByModelUUID(modelInfo.getModelVersionId()); // ModelVersionId is not required in v3 if(serviceRecord == null) { @@ -778,12 +782,16 @@ public class ServiceInstances { RequestParameters reqParam = msoRequest.getServiceInstancesRequest().getRequestDetails().getRequestParameters(); if(reqParam!=null && reqParam.isaLaCarteSet() && recipe==null){ return null; - }else if (recipe == null) { //aLaCarte wasn't sent, so we'll try the default + } + + //aLaCarte wasn't sent, so we'll try the default + serviceRecord = db.getServiceByModelName(defaultSourceServiceModelName); + if (serviceRecord == null) { serviceRecord = db.getServiceByModelName(defaultServiceModelName); - recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name()); } - if(modelInfo.getModelVersionId() == null) { + recipe = db.getServiceRecipeByModelUUID(serviceRecord.getModelUUID(), action.name()); + if(modelInfo.getModelVersionId() == null) { modelInfo.setModelVersionId(serviceRecord.getModelUUID()); } if(recipe==null){ |