Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> Prototype naming & queries
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1453895290

Message started by Mark Anderson on Jan 27th, 2016, 6:48am

Title: Prototype naming & queries
Post by Mark Anderson on Jan 27th, 2016, 6:48am

If you use prototypes it is often the case that derivative prototypes spur off. You start with 'pNote' and soon have 'pOldNote', 'pReferenceNote', etc. Then you realise you need to query for all the notes based on 'Note'-type prototypes. so you have to write a long query like:

Query:  $Prototype=="pNote" | $Prototype=="pOldNote" |$Prototype=="pReferenceNote"

But, don't overlook the (v6.4.0+) String operators .beginsWith() and .endsWith(). Thus the simpler query:

Query:  $Prototype.endsWith("Note")

..can save writing a much longer query were there a number of similar-named prototypes to which you need a match. Indeed, before posting this I forgot endsWith() and renamed my prototypes so the common ('Note') part was at the beginning ('pNote...') rather than the end as originally created. Duh!

You can re-name prototypes but do bear in mind that whilst notes using that prototype automatically update their $Prototype but any action that explicitly use the old prototype name will not be updated. So, if using similar/derivative sets of prototypes it pays to put the common part of the name consistently at the beginning or end of the $Name so you can easily use .beginsWith() and .endsWith().

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.