|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A rule manager gives you access to rules belonging to a particular rule owner. You can find out the rules associated with an owner and you can fire rules.
An owner is an identifier for a group of rules. You can create a group
of rules for a specific application by giving them an owner.
You can access rules associated with other
owners by specifying the owner ID with the rule
name, in the form ownerID.rulename
.
To instantiate a rule manager, call createRuleManager(), a static method of com.sssw.re.EboFactory. For a rule with no owner:
EbiRuleManager rm = EboFactory.createRuleManager();
For a rule with an owner:
String owner = "app1rules.rule1"; EbiRuleManager rm = EboFactory.createRuleManager(owner);
Method Summary | |
void |
echo(EbiContext context)
For rules that return a status of true or false, sets the response phrase in the context object to match the response status. |
EbiContext |
fireRule(String ruleID,
EbiContext context)
Executes a rule. |
EbiContext |
fireTemporaryRule(String ruleXML,
EbiContext context)
Executes a rule that you supply in XML format. |
String[] |
getActionMacroIDs()
Gets the names of the action macros. |
String[] |
getConditionMacroIDs()
Gets the names of the condition macros. |
boolean |
getLog()
Checks whether logging for the Rules subsystem is on or off. |
String[] |
getRuleIDs()
Gets the names of the rules associated with the rule manager's current owner. |
boolean |
isFalse(String ruleID,
EbiContext context)
Fires the specified rule and reports whether the rule returned a false value. |
boolean |
isTrue(String ruleID,
EbiContext context)
Fires the specified rule and reports whether the rule returned a true value. |
boolean |
ruleExists(String ruleID)
Returns true if a rule exists with the specified rule name for the rule manager's current owner. |
void |
setLog(boolean log)
Turns on runtime logging for the Rules subsystem . |
void |
setOwnerID(String ownerID)
Changes the owner associated with the rule manager. |
Method Detail |
public void setOwnerID(String ownerID)
ownerID
- A String specifying a valid owner ID. To specify the
default owner, specify a null value.public boolean getLog()
EbiRuleManager.setLog(boolean log)
public void setLog(boolean log)
log
- True to set logging on; false to set logging off.EbiRuleManager.getLog()
public String[] getRuleIDs()
public String[] getActionMacroIDs()
public String[] getConditionMacroIDs()
public boolean ruleExists(String ruleID)
ruleID
- the name of a rule. To specify a rule belonging to
the rule manager's current owner. For a rule with a different owner,
specify ownerID.ruleID
.public void echo(EbiContext context)
Status: 200
Status: 412
context
- the context object whose response phrase will be setpublic boolean isTrue(String ruleID, EbiContext context)
Rule result | Response status (int) | Response phrase (String) | isTrue return value | isFalse return value |
---|---|---|---|---|
true | 200 | Status: 200 | true | false |
false | 412 | Status: 412 | false | true |
ruleID
- the name of a rule. To specify a rule belonging to
the rule manager's current owner. For a rule with a different owner,
specify ownerID.ruleID
.context
- a context objectpublic boolean isFalse(String ruleID, EbiContext context)
EbiRuleManager.isTrue(String ruleID, com.sssw.re.api.EbiContext context)
.ruleID
- the name of a rule. To specify a rule belonging to
the rule manager's current owner. For a rule with a different owner,
specify ownerID.ruleID
.context
- a context objectpublic EbiContext fireRule(String ruleID, EbiContext context)
When firing a rule you need to handle the result of the rule's action. For implementation options see Handling the results of a rule in Director online help.
ruleID
- the name of a rule in the portal repository. If the rule
was installed with an owner, specify the owner before the rule name
like this: owner.rulename
.context
- Rule context object.EbiContext.fireRule(String)
,
EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.getResponseStatus()
public EbiContext fireTemporaryRule(String ruleXML, EbiContext context)
For more information, see Firing temporary rules in Director online help.
ruleXML
- a String whose value is an XML rule definitioncontext
- a context objectEbiContext.fireTemporaryRule(String)
,
EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.getResponseStatus()
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |