code: public List<AbstractPatternRule> getPatternRulesByIdAndSubId(String Id, String subId) {
      List<Rule> rules = getAllRules();
      List<AbstractPatternRule> rulesById = new ArrayList<>();   
      for (Rule rule : rules) {
        if (rule instanceof AbstractPatternRule &&
            rule.getId().equals(Id) && ((AbstractPatternRule) rule).getSubId().equals(subId)) {
          rulesById.add((AbstractPatternRule) rule);
        }
      }    
      return rulesById;
    }
docs: Get pattern rules by Id and SubId. This returns a list because rules that use {@code <or>...</or>}
  are internally expanded into several rules.
  @return a List of {@link Rule} objects
  @since 2.3