|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The firing strategy implements the function which takes the rules which were found
by the FindingStrategy
, (possibly modified by the FilteringStrategy
),
and fires each of the rules in order. An array containing the results of each rule is
returned.The FiringStrategy}, may be specified
using the TriggerPoint.setFiringStrategy()
method.
To specify one of the predefined firing strategies, use the static constants
on this interface.
A single default FiringStrategy is provided by BRBeans, as all types of rules are fired in the same way. This implementation takes each rule in order and performs the following steps:
The default firing strategy should be adequate for most purposes. One possible reason to implement a custom firing strategy may be to implement a judicial review strategy, where the results of each rule are passed into the next rule. Another possibility would be to implement a new firing strategy that logs every rule that is fired.
Field Summary | |
static FiringStrategy |
DEFAULT
The default firing strategy. |
Method Summary | |
java.lang.Object[] |
fireRules(TriggerPoint tp,
IRule[] rules,
java.lang.Object target,
java.lang.Object[] tpFiringParams)
Fires the rules which are given to it and returns the results of each one in an array. |
Field Detail |
public static final FiringStrategy DEFAULT
Method Detail |
public java.lang.Object[] fireRules(TriggerPoint tp, IRule[] rules, java.lang.Object target, java.lang.Object[] tpFiringParams) throws BusinessRuleBeansException
CombiningStrategy
.
Part of the work done by this method is to determine what firing parameters are to be passed to the rules being fired. Normally the firing parameters passed should be the firing parameters passed on the trigger point or, if firing parameters are specified in the rule itself, then these should be passed. However, the programmer writing his or her own firing strategy can override this behavior.
DefaultFiringStrategy
provides more details about writing
your own firing strategy.
tp
- the trigger point which is used to make this callrules
- the ordered array of rules which are to be firedtarget
- the target object which was passed on the trigger pointtpFiringParams
- the firingParams which were passed on the trigger pointBusinessRuleBeansException
- if any exceptions occur
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |