Posted Conditions
Posted Conditions are "posted" when a ConsequenceAction object invokes the method postCondition on the RuleBaseEngine microagent. A posted condition is an internal status message, similar to an alert message. It takes a single argument called 'condition'. The following code fragment constructs a valid ConsequenceAction which posts the condition "disk full":
DataElement[] args =
{new DataElement("condition", new PostedCondition("disk full"))};
MethodInvocation mi =
new MethodInvocation("postCondition", args);
ConsequenceAction ca =
new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi);
new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi);
A ClearAction may not contain a MethodInvocation with the postCondition method. Posted Conditions are "cleared" or "unposted" when the enclosing Test object transitions T->F. Posted conditions provide a mechanism for different rules within the same rulebase to communicate. One of the restrictions on posted conditions is that no two ConsequenceAction objects in the same rulebase may post the same condition (conditionName). This is enforced by the methods that construct and edit Rulebase objects.
Another restriction is that a posted condition may not be referenced (used in a test operator) from within the same Rule that generates it. (Rules contain tests, tests contain actions, and actions can post conditions. Thus all posted conditions are posted within the context of a particular rule but may only be referenced in tests of other rules in the same rulebase.) This is enforced by the methods that construct and edit Rule objects.
For more information on posted conditions, see the TIBCO Hawk Administrator's Guide.