private static String replaceSubstitutionVariables(String pParsedStatementString, PromotionFile pPromotionFile) 
  throws ExLoader {
    
    //Replace variables only if one exists and a property has not been set instructing not to substitute 
    if(pParsedStatementString.indexOf("$${") > 0){
      if(!"true".equals(pPromotionFile.getPropertyMap().get(SKIP_SUBSTITUTION_PROPERTY_NAME))){
        Logger.logDebug("Performing variable substitution for " + pPromotionFile.getFilePath());
        
        StringBuffer lReplacedStatementString = new StringBuffer();
        
        Matcher lMatcher = SUBSTITUTION_VARIABLE_PATTERN.matcher(pParsedStatementString);
        
        while (lMatcher.find()) {
          String lParamName = lMatcher.group(1).toLowerCase();
          
          String lParamValue = pPromotionFile.getPropertyMap().get(lParamName);
          if(lParamValue == null){
            throw new ExLoader("Parameter value for '" + lParamName + "' substitution variable not defined");
          }
          
          lMatcher.appendReplacement(lReplacedStatementString, lParamValue);
        }
        lMatcher.appendTail(lReplacedStatementString);
        
        return lReplacedStatementString.toString();
      }
      else {
        Logger.logDebug("Skipping variable substitution for " + pPromotionFile.getFilePath() + " because " + SKIP_SUBSTITUTION_PROPERTY_NAME + " was true");
      }
    }
    
    //Skipping
    return pParsedStatementString;
  }