# com.bea.p13n.rules.manager
RulesManager Interface

public interface RulesManager
extends `EJBObject`, `RuleSetRepository`

This interface defines a stateless API for executing named rule sets and/or rules using the underlying BEA rules engine. This interface is exposed as a stateless session EJB that can be created using the `RulesManagerHome`.

Related Topics

``RulesManagerHome``

All Superinterfaces
  `EJBObject`, `Remote`, `RuleSetRepository`

## Field Summary

`public static final `String`` | `RULESET_REPOSITORY_CLASS_NAME` The environment entry key for reading the `RuleSetRepository` implementation class name.

Fields from interface com.bea.p13n.rules.manager`.`RuleSetRepository``
``BINARY_FORMAT`, `STRING_FORMAT``

## Method Summary

`public `Iterator`` | `evaluateRule`(`String` ruleSetUri, `String` ruleName, `Object`[] inputObjects) Applies a named rule to the set of objects provided by the caller and returns an iterator over the resultant set of objects.
`public `Iterator`` | `evaluateRule`(`String` ruleSetUri, `String` ruleName, `Object`[] inputObjects, `ObjectFilter` filter) Applies a named rule to the set of objects provided by the caller and returns an iterator over the resultant set of objects that pass the given filter.
`public `Iterator`` | `evaluateRuleSet`(`String` ruleSetUri, `Object`[] inputObjects) Applies a named set of rules to the set of objects provided by the caller and returns an iterator over the resultant set of objects.
`public `Iterator`` | `evaluateRuleSet`(`String` ruleSetUri, `Object`[] inputObjects, `ObjectFilter` filter) Applies a named set of rules to the set of objects provided by the caller and returns an iterator over the resultant set of objects that pass the given filter.
`public `String`` | `getRuleSet`(`String` ruleSetUri) Retrieves the XML string representation of the rule set with the given URI.

Methods from interface `javax.ejb.`EJBObject``
`getEJBHome, getHandle, getPrimaryKey, isIdentical, remove`

Methods from interface `com.bea.p13n.rules.manager.`RuleSetRepository``
``getRuleSet`, `getRuleSets`, `removeRuleSet`, `setRuleSet``

## Field Detail

### RULESET_REPOSITORY_CLASS_NAME

    public static final String RULESET_REPOSITORY_CLASS_NAME

  The environment entry key for reading the `RuleSetRepository` implementation class name. All methods defined on the `RuleSetRespository` interface are delegated to an instance of this class.

## Method Detail

### evaluateRule(String, String, Object[]) Method

    public Iterator evaluateRule(String ruleSetUri,
                                 String ruleName,
                                 Object[] inputObjects)
         throws RemoteException, IllegalArgumentException, ApplicationException

Applies a named rule to the set of objects provided by the caller and returns an iterator over the resultant set of objects.

#### Parameters

ruleSetUri
  The URI of the rule set which contains the rule to be executed.

ruleName
  The name of the rule to be executed.

inputObjects
  The set of objects to which the rule is to be applied

#### Returns

The set of objects which resulted from the application of the rule.

#### Exceptions

``RemoteException``
  if a communication error occurs during the execution of a remote method call.
``IllegalArgumentException``
  if `ruleSetUri` or `ruleName` are `null` or zero-length, or if `inputObjects` is `null`.
``ApplicationException``
  if the rule set execution subsystem is unable to execute the rule.

### evaluateRule(String, String, Object[], ObjectFilter) Method

    public Iterator evaluateRule(String ruleSetUri,
                                 String ruleName,
                                 Object[] inputObjects,
                                 ObjectFilter filter)
         throws RemoteException, IllegalArgumentException, ApplicationException

Applies a named rule to the set of objects provided by the caller and returns an iterator over the resultant set of objects that pass the given filter.

#### Parameters

ruleSetUri
  The URI of the rule set which contains the rule to be executed.

ruleName
  The name of the rule to be executed.

inputObjects
  The set of objects to which the rule is to be applied

filter
  An `ObjectFilter` used to filter the results of rule exection.

#### Returns

A filtered set of objects which resulted from the application of the rule.

#### Exceptions

``RemoteException``
  if a communication error occurs during the execution of a remote method call.
``IllegalArgumentException``
  if `ruleSetUri` or `ruleName` are `null` or zero-length, or if `inputObjects` is `null`.
``ApplicationException``
  if the rule set execution subsystem is unable to execute the rule.

### evaluateRuleSet(String, Object[]) Method

    public Iterator evaluateRuleSet(String ruleSetUri,
                                    Object[] inputObjects)
         throws RemoteException, IllegalArgumentException, ApplicationException

Applies a named set of rules to the set of objects provided by the caller and returns an iterator over the resultant set of objects.

#### Parameters

ruleSetUri
  The URI of the rule set which contains the set of rules.

inputObjects
  The set of objects to which the rules are to be applied.

#### Returns

The set of objects which resulted from the application of the rules.

#### Exceptions

``RemoteException``
  if a communication error occurs during the execution of a remote method call.
``IllegalArgumentException``
  if `ruleSetUri` is `null` or zero-length, or if `inputObjects` is `null`.
``ApplicationException``
  if the rule set execution subsystem is unable to execute the rule set.

### evaluateRuleSet(String, Object[], ObjectFilter) Method

    public Iterator evaluateRuleSet(String ruleSetUri,
                                    Object[] inputObjects,
                                    ObjectFilter filter)
         throws RemoteException, IllegalArgumentException, ApplicationException

Applies a named set of rules to the set of objects provided by the caller and returns an iterator over the resultant set of objects that pass the given filter.

#### Parameters

ruleSetUri
  The URI of the rule set which contains the set of rules.

inputObjects
  The set of objects to which the rules are to be applied

filter
  An `ObjectFilter` used to filter the results of rule exection.

#### Returns

A filtered set of objects which resulted from the application of the rules.

#### Exceptions

``RemoteException``
  if a communication error occurs during the execution of a remote method call.
``IllegalArgumentException``
  if `ruleSetUri` is `null` or zero-length, or if `inputObjects` is `null`.
``ApplicationException``
  if the rule set execution subsystem is unable to execute the rule set.

### getRuleSet(String) Method

DEPRECATED replaced by `com.bea.p13n.rules.manager.RuleSetRepository.getRuleSet(java.lang.String, int)```

    public String getRuleSet(String ruleSetUri)
         throws RuleSetNotFoundException, ApplicationException, IllegalArgumentException, RemoteException

Retrieves the XML string representation of the rule set with the given URI.

#### Parameters

ruleSetUri
  the URI of the target rule set.

#### Returns

the XML representing the rule set.

#### Exceptions

``RuleSetNotFoundException``
  if the rule set referenced by the supplied URI cannot be located by the rule set repository subsystem.
``ApplicationException``
  if the rule set repository subsystem is unable to retrieve the rule set.
``IllegalArgumentException``
  if the `ruleSetUri` is an invalid rule set URI.
``RemoteException``
  if a communication error occurs during the execution of a remote method call.