BRLRuleModel extends RuleModel { @Override public List<String> getLHSVariables(final boolean includePatterns, final boolean includeFields) { final Set<String> variables = new HashSet<>(); for (CompositeColumn<? extends BaseColumn> col : dtable.getConditions()) { if (col instanceof Pattern52) { final Pattern52 p = (Pattern52) col; if (p.isBound()) { if (includePatterns) { variables.add(p.getBoundName()); } } for (ConditionCol52 cc : p.getChildColumns()) { if (cc.isBound()) { if (includeFields) { variables.add(cc.getBinding()); } } } } else if (col instanceof BRLConditionColumn) { final RuleModel rm = new RuleModel(); final BRLConditionColumn brl = (BRLConditionColumn) col; rm.lhs = brl.getDefinition().toArray(new IPattern[brl.getDefinition().size()]); variables.addAll(rm.getLHSVariables(includePatterns, includeFields)); } } variables.addAll(super.getLHSVariables(includePatterns, includeFields)); return new ArrayList<>(variables); } BRLRuleModel();  BRLRuleModel(final GuidedDecisionTable52 dtable); @Override List<String> getLHSBoundFacts(); @Override FactPattern getLHSBoundFact(final String var); @Override SingleFieldConstraint getLHSBoundField(final String var); @Override String getLHSBindingType(final String var); @Override FactPattern getLHSParentFactPatternForBinding(final String var); @Override List<String> getAllVariables(); @Override List<String> getAllLHSVariables(); @Override List<String> getLHSPatternVariables(); @Override List<String> getLHSVariables(final boolean includePatterns,
                                        final boolean includeFields); @Override List<String> getAllRHSVariables(); @Override boolean isBoundFactUsed(final String binding); @Override List<String> getBoundVariablesInScope(final BaseSingleFieldConstraint con); @Override boolean isVariableNameUsed(String s); @Override List<String> getRHSBoundFacts(); @Override ActionInsertFact getRHSBoundFact(final String var);  }
@Test public void checkGetLHSFieldVariables() { whenThereIsADecisionTableWithPatternsAndBRLCondition(); assertThereAreBindings(() -> rm.getLHSVariables(false, true), "$f1", "$f2"); }