@ Override public Map < RuleSet , List < Rule > > matching ( Rules rules , Map < String , Object > vars , boolean ignoreMethodErrors ) throws OgnlException { Map < RuleSet , List < Rule > > ret = new HashMap <> ( ) ; for ( RuleSet ruleSet : rules . ruleSets ) { try { OgnlContext context = createContext ( vars ) ; List < Rule > matching = match ( ruleSet , context ) ; if ( ! matching . isEmpty ( ) ) { ret . put ( ruleSet , matching ) ; } } catch ( MethodFailedException mfe ) { if ( ! ignoreMethodErrors ) { throw mfe ; } log . warn ( "Method failed for ruleset " + ruleSet . id , mfe ) ; } } return ret ; }
returns a list of the rules that match from the supplied Rules document