Actions & Rules

Tinderbox Icon

An action is an automatic way of setting a certain attribute to a certain value (with the exception of system read-only attributes which can't be altered). 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 form 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 can be added as both and action and a rule.

Important note: action code can not create new notes or delete existing ones.

Actions and rules may use simple arithmetic and logical expressions.

$Width=5+2; 

$Width=$Height(parent)*1.5; 

$Urgent= (Overdue | Essential); 

$Width =($Width(/Configuration)+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. Quoting characters will always cause Tinderbox to treat such content as literal text.

Actions and rules may use computation with data attributes - including attribute values 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 and date designators:

$DueDate = "November 15, 2004" + "7 weeks" 

Note in the previous examples the actual and partial date strings use quotes.

Long term users should revisit code to ensure all string literals are quoted as current support for non-quoted string usage is for legacy purposes and will be withdrawn.


Up: A Tinderbox Reference File
Previous: Attributes  Next: Agent Queries 

A Tinderbox Reference File : Actions & Rules aTbRef Site Map


[Last updated: 15 Jan 2012, using v5.10.0]

Google search aTbRef for:  

Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox