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 not updating a particular note with rule
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1421958935

Message started by Ralph Alvy on Jan 22nd, 2015, 3:35pm

Title: Prototype not updating a particular note with rule
Post by Ralph Alvy on Jan 22nd, 2015, 3:35pm

I notice that after I change a particular prototype's rule, one particular note doesn't get its rule changed, even though that note has the prototype referenced here. I assume this is because I altered that note's rule at one point, so I deleted that note's rule and then unselected and reselected that prototype for that note. That fails to fix this. How to I get a note back to its virgin state vis a vis its rule, so it can then inherit its prototype's rule?

For now, I have recreated that note and copied all its children into its new incarnation, and that new one works fine. I'm saving the old problem note to manipulate and learn from, after I hear back from the forum.

Title: Re: Prototype not updating a particular note with rule
Post by Mark Anderson on Jan 22nd, 2015, 4:26pm

You need to reset inheritance. There are many ways. The way I use it this. Open Get Info for the note with the bad rule. Select Attributes -> General and scroll the list so you can see 'Rule'. Aside: the line will be shown in bold indicating that it is a locally set and not inherited value. Right-lick in the Rule's line in in the table then click the pop-up menu item "Use Inherited Value".  The Rule data should now be drawn in normal weight font indicating it is now no longer locally set and the rule's value box should show the prototype's rule.

More on resetting inheritance via Action code..

Title: Re: Prototype not updating a particular note with rule
Post by Mark Bernstein on Jan 22nd, 2015, 5:45pm

To clarify: you need to reset that noteís inheritance because that note already has a rule.

If a note has a value for $Rule, thatís its $Rule.  If it doesnít, Tinderbox checks the prototype for $Rule; if the prototype has a $Rule, thatís it. If not, we check the prototype of the prototype.  If we have no prototype, or if no prototype has a $Rule, we use the default value of $Rule.

Title: Re: Prototype not updating a particular note with rule
Post by Ralph Alvy on Jan 22nd, 2015, 7:12pm

That problem note has no rule, and the Info screen verifies that (the rule value in the Info screen is blank). It has no rule because I deleted the entire local rule. But it will not inherit the prototype's rule after I apply the prototype to it. I figured that was because it once had a local rule, even though it has none now.

But I see that using the Info screen, I can get it to inherit the prototype's rule.

Title: Re: Prototype not updating a particular note with rule
Post by Mark Anderson on Jan 23rd, 2015, 3:07am

You'd probably find it helpful to read this article on inheritance in TB and then this one on prototype-based inheritance in TB.

From that it should then be clear why simply deleting a locally set rule does re-enable inheritance. Simply deleting a rule sets a local value of an empty string which is not the same as no value, such as will enable inheritance.

Title: Re: Prototype not updating a particular note with rule
Post by Ralph Alvy on Jan 24th, 2015, 11:53am

Maybe a future version of TB can have a button on the Inspector|Rule tab that allows the user to Use Inherited Value.

Title: Re: Prototype not updating a particular note with rule
Post by Mark Anderson on Jan 25th, 2015, 4:41am

Further to Ralph's point, the Rule inspector could usefully show its inheritance vs local value status as a visual cue given that it is a primary place for rule insertion/review.

Title: Re: Prototype not updating a particular note with rule
Post by andreas grimm on Jan 26th, 2015, 10:08am

To give Ralph's question yet another spin:

Given a prototype P inherits its keyAttribute "URL" to the note N since N uses P as its prototype.

Hence one adds the keyAttribute "publicationCity" to N. Means: One has now a note N showing both the keyAttribute "URL" inherited from P and the keyAttribute "publicationCity" only N holds.

NOW one decides to add "Publisher" as another keyAttribute to P. One assumes that this second keyAttribute will be inherited to N as well. But that's not the case.

Even if one is deleting the keyAttribute "publicationCity" that only N holds does not reset or re-establish full inheritance-dependency between N and its prototype P.

In other words: As soon as someone messes with keyAttributes in a note that inherited keyAttributes from a prototype the inheritance-dependency is broken and can not -- at least to my knowledge -- be re-established.

Any ideas?
Cheers!

Title: Re: Prototype not updating a particular note with rule
Post by Mark Anderson on Jan 26th, 2015, 12:47pm


Quote:
NOW one decides to add "Publisher" as another keyAttribute to P. One assumes that this second keyAttribute will be inherited to N as well. But that's not the case.

You assume incorrectly. TB is behaving as documented. The items sown in this the Key Attributes table is stored in/inherited as the value of attribute $KeyAttributes. By editing $KeyAttributes in N you remove all further inheritance of $KeyAttributes as N now uses the local value of the attribute.

If you simply delete the local value of $KeyAttributes in N you've now set it to a local value of "", i.e. no attributes. It is still a locally set value. To make it inherit again from P you must reset inheritance as already described.

I also suggest reading these 2 tutorials on TB6 Inheritance and on inheritance via prototypes. That may avoid further incorrect assumptions about how inheritance works.

Title: Re: Prototype not updating a particular note with rule
Post by andreas grimm on Jan 26th, 2015, 3:42pm

Thanks, Mark for your quick reply.

I studied both tutorials. Resetting inheritance (using: Get Info... --> attributes --> KeyAttributes --> [right click] "Use Inherited Value") indeed brought back the initial set of KeyAttributes created in the Prototype.

Best
a


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.