org.obligate.annotations.contract.proxy
Interface RulesProxy

All Known Implementing Classes:
GroovyRulesProxy

public interface RulesProxy

Provides a simple proxy to the rules engine being used. This only needs a single instance across all the proxies.

Since:
27-Jan-2006
Author:
Andy Hedges

Method Summary
 java.util.List<ConditionResult> evaluateRules(java.lang.String ruleName, java.util.List inputData)
          Evaluate a named rule set
 boolean isRegistered(java.lang.String ruleName)
           
 boolean registerRules(java.lang.String ruleName, java.lang.String[] conditions, java.lang.String[] paramNames)
          Method that takes the rules and registers them against the rules engine the name parameter is the key to getting those things back so it needs to be unique (probably method signature)
 

Method Detail

registerRules

boolean registerRules(java.lang.String ruleName,
                      java.lang.String[] conditions,
                      java.lang.String[] paramNames)
                      throws javax.rules.RuleException,
                             java.rmi.RemoteException
Method that takes the rules and registers them against the rules engine the name parameter is the key to getting those things back so it needs to be unique (probably method signature)

Parameters:
ruleName - the rules to execute
conditions - the rules to evaluate
paramNames - the parameter names to use in the rules, part of the binding
Returns:
whether the registration succeeded.
Throws:
javax.rules.admin.RuleExecutionSetCreateException
java.rmi.RemoteException
javax.rules.admin.RuleExecutionSetRegisterException
javax.rules.RuleException

isRegistered

boolean isRegistered(java.lang.String ruleName)
Parameters:
ruleName -
Returns:
whether the given rule set has already been registered

evaluateRules

java.util.List<ConditionResult> evaluateRules(java.lang.String ruleName,
                                              java.util.List inputData)
                                              throws javax.rules.RuleException,
                                                     java.rmi.RemoteException
Evaluate a named rule set

Parameters:
ruleName - the rule set to execute
inputData - the data to perform the evaluation on
Returns:
whether all the rules passed
Throws:
java.rmi.RemoteException
javax.rules.RuleException