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 >> assign note attribute based on adornment attribute
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1443630833

Message started by Anand on Sep 30th, 2015, 12:33pm

Title: assign note attribute based on adornment attribute
Post by Anand on Sep 30th, 2015, 12:33pm

Consider a Note sitting "in" an Adornment.
The Note has an attribute called Note_Attribute, and similarly, the Adornment has an Adornment_Attribute.

I'd like to assign a value to Note_Attribute based on the value of Adornment_Attribute.

Importantly, I'd like to perform this assignment as a Rule for the Note, not just when the Note is first added to the Adornment.

Any suggestions would be very welcome.

Thanks.

Title: Re: assign note attribute based on adornment attribute
Post by Mark Bernstein on Sep 30th, 2015, 1:14pm

First, do consider using an OnAdd action if you can. They're easier to work with and also more efficient.  

Second, consider using an agent; they're also easier to work with, and somewhat more efficient.

But, if "apple" is an adornment at the top level, the rule

     if(inside(/apple)) {$Color="red"}

will do what you want. Or, explicitly

    if(inside(/apple)) {$NodeAttribute=$AdornmentAttribute(/apple);}

Title: Re: assign note attribute based on adornment attribute
Post by Anand on Oct 1st, 2015, 1:11pm

Thanks, Mark. I did not realize that an argument to inside() could refer to an adornment. This is very useful.

I have two minor questions regarding the path provided to inside(). I will start a new thread since it is a bit off-topic.

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.