Actions & Rules

Tinderbox Icon

An action is an automatic way of setting a certain attribute to a certain value. In the context of this section, Rules should regarded as synonymous as they differ only in the scope of action.

Agents can have actions. An agent performs its action on all the notes it finds that match its agent query.

Notes can have actions. A note performs its action on all its children — but not on the children's children, i.e. descendants. A Rule is a special sort of note action whose effect is applied only to the note and not any children. To effect both the note and children, the same code code be added as both and action and a rule.

Actions and rules may use simple arithmetic and logical expressions.

Width=5+2;

Width=$Height(parent)*1.5;

Urgent= (Overdue | Essential);

Width = (^getFor(/Configuration,Width)^+1)*$Scale;

Because Tinderbox recognises operators such as + and -, notes whose names begin with characters other than letters and numbers may sometimes be interpreted in unexpected ways. For example, if a note is named "6*7", rules like

Prototype=6*7

...might be parsed as a multiplication with the result of 42.

Prototype="6*7"

...should have the expected effect.

Actions and rules may use computation with data attributes - including attribute value from other notes. For example:

DueDate=$DueDate(parent)+7 days;

DueDate=$ExpiryDate(parent)-10 days;

Date attribute values can also be computed with literal dates:

DueDate=November 15, 2004 + 7 weeks

With the expansion of action code in v4.0+, use of export codes is deprecated were action code alternatives exist. Existing users with legacy TBX files may find it worthwhile to review and update their actions written pre-v4 to use the newer syntax. It is also a good rule of thumb that post-v4.0 all string literals (actual pieces of text - not placeholders, attribute names, etc.) should be placed in double-quotes whenever used in code.


Up: A Tinderbox Reference File
Previous: Agent Queries  Next: Export Codes 

[Last updated: 1 Dec 2008]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox