This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere.
Jump to the current version of aTbRef.
|A Tinderbox Reference File : Objects & Concepts : Rules|
A Rule is an action, much like an agent action, but while agents act on other notes a Rule acts on it own note (and only that note).
Rules are actions attached to notes and containers. Agents may have rules.
Rules are run periodically, and change the note's attributes. For example, suppose we have a Boolean attribute called Urgent. A note might have a rule
...meaning, "this note is urgent if any of its immediate children are urgent."
Another rule might be
...meaning, "this note is urgent if its parent is urgent."
Given that rules run periodically, Tinderbox will eventually enforce each rule, although there may be a delay between a change made to one note and its impact throughout the document depending on the agent update (cycle) time, i.e. in complex TBXs the update time may be a little slower.
Notice, too, that contradictory rules can be written; this may lead to constant changes in the document and should be avoided.
Agents can have rules and this is especially useful for highlighting agents under specified circumstances (e.g. if UrgentTasks isn't empty, or if ThingsToDo find more than seven tasks in your inbox).
In order to make Tinderbox code run in actions and rules it may necessary to start the code after the = sign with a caret and a space, e.g. "^ ". This mechanism is not explained in the manual.
[Rules were introduced in v2.4.0]
From v 3.0.0 Actions and rules may now use simple arithmetic and logical expressions.
|Up: Objects & Concepts|
|Previous: Prototypes||Next: Macros|
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]