Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Possible to force rule execution after checkbox (Read 3429 times)
Stefan Klocke
Full Member
*
Offline



Posts: 3

Possible to force rule execution after checkbox
Dec 17th, 2014, 1:54pm
 
Dear All,

I am a longish time, on off user of Tinderbox.
With Version 6 I have started to develop a new project.

For this, I have created a small conversion feature for a note. A numerical attribute can be set manually, a boolean checkbox decides the unit. A rule will calculate a final value in a 2nd attribute depending on the state of the check box. Toggling the checkbox, on off on off ...., will quickly bring the presentation out of sync. The final value does not match the checkbox state. Viewing other notes and then returning to this one will find things in proper synchronization. This brings me to the following question:

Is it possible to sync the checkbox status change with the rule execution?

Stefan


Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Possible to force rule execution after checkbox
Reply #1 - Dec 17th, 2014, 5:42pm
 
Rules are read/run on a cycle of all notes. If note B's rule depends on a change in note A, then it can take a cycle or more (for more complex code as you appear to have) for the execution to complete. So it's not an issue of 'sync' but one of waiting for the code to complete.

When you tick a box as a key attribute, the attribute value is changed. The note's rule, which may then do something with the note's attributes, is fired as part of the normal rule cycle (but see below re stamps).

It's hard to comment further without seeing the rules but often I little optimisation of the code (or even where notes/agent sit in the outline order, and thus rule cycle) can help improve the apparent responsiveness of your TBX design.

Also consider a stamp as a 'run-once-on-demand' form of rule. Using the OS or utilities like Keyboard Maestro you can also apply shortcuts to your stamps. I've not done this personally but i think some folk here do that quite a lot.

Do ask again if still stuck.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Possible to force rule execution after checkbox
Reply #2 - Dec 18th, 2014, 10:57am
 
The Agents & Rules pane of the Tinderbox inspector will indicate the rule manager’s progress through the document.  For most situations, this is fast enough.

For your situation, where the rule really only needs to be run once, I agree that a stamp might be just the thing.

Looking ahead, we’re also planning a facility for rules that only need to be run occasionally -- rules that do routine housekeeping, for example, or that archive obsolete notes.  This may help people make rules run faster by avoiding lots of rules which seldom do anything.

    "Does this need to be archived yet?  Nope!”
    “How ’bout this? Nope!”
    “How ’bout this? Nope!”
    (repeat a thousand times)
    All done. Phew!  Now, let’s check again!    
    "Does this need to be archived yet?  Nope!”
Back to top
 
 
WWW   IP Logged
Stefan Klocke
Full Member
*
Offline



Posts: 3

Re: Possible to force rule execution after checkbox
Reply #3 - Dec 18th, 2014, 4:42pm
 
Thank you Mark and Mark for the detailed answers. I did not consider using a stamp. Maybe this is the way to go.

I abuse/overlaod the checkbox as a rule starter and modifier at the same time.
My TB "project" is more of a cross between a spreadsheet and a report writing tool. In this respect I desire to kick off some processing at some point in some or many Notes. This could be the calculation of sums (less so) or the compilation of textual information. From where I come from I would love to see a mix of Tinderbox and PERL (or whatever one would consider these days), so that one has Hash and array structures with proper scoping.

Mark B's outlook is in this respect promising. With my limited TB experience I would like to see the availability of a (configurable) "start rule" button that a note could have, like it has the "link landing" place. This would also help when testing, especially if this was also present in the rule inspector. Maybe more than one rule is another interesting idea in this respect.
Back to top
 
 
  IP Logged
MJ Mastroianni
Full Member
*
Offline



Posts: 36

Re: Possible to force rule execution after checkbox
Reply #4 - Dec 18th, 2014, 7:28pm
 
This might be the place to suggest something:

To Mark B.: I really like this idea of being able to selectively run rules or actions. Have you ever considered the addition of something akin to a standard UI button? I think adding the ability to click on a button that is located conveniently in map view (perhaps pinned to an adornment) and execute a desired action would be great.

Anything along the line of enhancing the ability to create a set of controls that effectively creates a kind of "Control Center" could really augment Tinderbox's power, IMHO. It's the "clickable" nature of a custom UI that excites me, because it means that one could realistically develop very direct means to execute frequently used operations with minimal effort.

I'm thinking here of a button labeled "Clear" for example, that initializes a particular state of a Tinderbox document, perhaps. For example, marking all task statuses of a certain type as Incomplete for the start of a new work week. There could be many other examples, of course.

It might also prove to be just the thing to encourage the use of Tinderbox in more dynamic situations such as presentations, with a little more control and safety (i.e., less "cognitive load" needed to launch an automated process.)

No doubt that there are many ways to approach such a feature, including adding a note attribute that defines the note as an actionable UI button, as in "RunActionWhenClicked", or even "RunActionWhenDblClicked". Just a thought ...
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Possible to force rule execution after checkbox
Reply #5 - Dec 19th, 2014, 10:22am
 
MJ Mastroianni: I think this needs a little fuller exposition, perhaps with some sketches, to explain just what these new features are (from the description, they sound quite ambitious though possible) and how they'd do things you can't accomplish with (e.g.) stamps or adornment actions.
Back to top
 
 
WWW   IP Logged
MJ Mastroianni
Full Member
*
Offline



Posts: 36

Re: Possible to force rule execution after checkbox
Reply #6 - Dec 19th, 2014, 2:38pm
 
Hi Mark B: There is only one aspect that can't be done by stamps or adornment actions, AFAIK: the ability to just click an object to execute an action. That's it. (Unless there is something in Tinderbox I've missed that does allow this directly.)

My suggestion about maybe allowing a note to have a clickable trigger, etc., was merely a brainstorm about how an existing object might be extended to become a button, that's all, since notes appear in map view and on adornments when desired. I just like the idea that I could place a visible object or objects somewhere on a map and click them to run actions, a kind of simple application control panel. Maybe it could simply be a stamp, that gets a graphical representation.

I'd like to see a feature something like this because it lends itself to making Tinderbox documents seem more directly an application than a sort of intelligent database that also enforces rules. Really a stamp *does* everything that this would do, other than being simply "clickable." (But I acknowledge that I haven't seen any desire for this enhancement in Forum to date, really, either ...)
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print