|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RuleBlock
This interface represents a rule block within a ruleset. A rule block contains a list of rules
that are executed at runtime to perform the function of the rule block. The order of the
rules in the list determines the order in which they are executed. Each rule is either a
hard-coded rule or is a rule that was created based on a rule template. Hard-coded rules
cannot be changed, added, or removed by this API. They can, however, be reordered using
either the moveUp
, moveDown
, or move
methods. Rules
created from a rule template (template instance rules) can be reordered, just like hard-coded
rules. They can also be created, added to the rule block, and removed from the rule block.
The removeRule
method can be used to remove a given template instance rule from
the rule block. To add a new template instance rule, first create a rule based on the
template using the
createRuleFromTemplate
method on the RuleTemplate
class and then add it to the rule block using one of
the addRule
methods.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
Method Summary | |
---|---|
void |
addRule(int index,
RuleSetTemplateInstanceRule newRule)
Insert the specified rule at the specified index in the list of rules in this rule block. |
void |
addRule(RuleSetTemplateInstanceRule newRule)
Add the specified rule to the end of the list of rules in this rule block. |
RuleSet |
getParentRuleSet()
Get the ruleset that contains this rule block. |
RuleSetRule |
getRule(int index)
Get the rule at the specified index in the list of rules for this rule block. |
java.util.Iterator<RuleSetRule> |
iterator()
Get an iterator over the list of rules in this rule block. |
void |
move(RuleSetRule ruleToMove,
int newIndex)
Move the specified rule to the specified index in the list of rules for this rule block. |
void |
moveDown(RuleSetRule ruleToMove)
Move the specified rule down in the list of rules for this rule block. |
void |
moveUp(RuleSetRule ruleToMove)
Move the specified rule up in the list of rules for this rule block. |
int |
numberOfRules()
Get the number of rules in this rule block. |
boolean |
removeRule(RuleSetTemplateInstanceRule rule)
Remove the specified rule from the list of rules in this rule block. |
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleValidateable |
---|
validate |
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleChangeDetector |
---|
hasChanges |
Field Detail |
---|
static final java.lang.String COPYRIGHT
Method Detail |
---|
java.util.Iterator<RuleSetRule> iterator()
remove
method of the Iterator
interface. If that method is
called, an UnsupportedOperationException
is thrown.
Other methods on the RuleBlock
class are used to make structural
modifications to the list of rules. These methods synchronize on this RuleBlock
object. If the client code is multi-threaded, you should synchronize on the
RuleBlock
object while using the iterator.
iterator
in interface java.lang.Iterable<RuleSetRule>
RuleSetRule getRule(int index)
index
- The index of the rule to retrieve.
void addRule(RuleSetTemplateInstanceRule newRule) throws ValidationException
ValidationException
is thrown. The name of the new rule must also
not already be in used for another rule in this rule block.
newRule
- The rule to be added to this rule block. If null, then an
IllegalArgumentException
is thrown.
ValidationException
- if any of the following are true:
java.lang.IllegalArgumentException
- if newRule is null.
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.void addRule(int index, RuleSetTemplateInstanceRule newRule) throws ValidationException
ValidationException
is thrown. The name of the new rule must also
not already be in used for another rule in this rule block.
index
- The index at which the new rule is to be inserted. The index is zero-based
so the first rule in the rule block has index 0.newRule
- The rule to be added to this rule block. If null, then a
IllegalArgumentException
is thrown.
ValidationException
- if any of the following are true:
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index > numberOfRules()).
java.lang.IllegalArgumentException
- if newRule is null.
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.boolean removeRule(RuleSetTemplateInstanceRule rule)
rule
- The rule to be removed. Must be of type TemplateInstanceRule
since only rules that were originally created from a rule template can be removed. If
null, then an IllegalArgumentException
is thrown.
RuleBlock
contained the specified template instance rule.
Otherwise false.
java.lang.IllegalArgumentException
- if rule is null.
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.void moveUp(RuleSetRule ruleToMove) throws java.lang.IllegalArgumentException
ruleToMove
- The rule to be moved.
java.lang.IllegalArgumentException
- if the specified rule is null or is not in the list of
rules for this rule block.
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.void moveDown(RuleSetRule ruleToMove) throws java.lang.IllegalArgumentException
ruleToMove
- The rule to be moved.
java.lang.IllegalArgumentException
- if the specified rule is null or is not in the list of
rules for this rule block.
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.void move(RuleSetRule ruleToMove, int newIndex) throws java.lang.IllegalArgumentException
ruleToMove
- The rule to be moved.newIndex
- The new index for the rule. The index is zero-based so the first
rule in the rule block has index 0.
java.lang.IllegalArgumentException
- if the specified rule is null or is not in the
list of rules for this rule block
java.lang.IndexOutOfBoundsException
- if newIndex is out of range (newIndex < 0 ||
newIndex >= numberOfRules())
ChangesNotAllowedException
- if changes to this object are temporarily
disallowed while other changes are being published.int numberOfRules()
RuleSet getParentRuleSet()
RuleSet
that contains this RuleBlock
.
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |