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
Agent for GTD-use possible? (Read 6884 times)
AndreasE
Full Member
*
Offline



Posts: 15

Agent for GTD-use possible?
Jan 02nd, 2008, 4:30am
 
I have created a long outline of projects, each broken down into steps and finally into some actions. Actions that can start immediately get the badge "next".

I would now like to have an agent that lists all projects that do not have at least one action with Badge=next below them. Is that possible, and if yes, how would the condition look like?

This is for GTD-like purposes, of course: These are the projects I have to think about more thoroughly how to attack them.

I have to add I am quite new to Tinderbox. So, any hints are very welcome!
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agent for GTD-use possible?
Reply #1 - Jan 2nd, 2008, 11:15am
 
My strategy for this task would be to break up the work into three parts.

First, we'll define a new boolean attribute, HasNextTask.  It's true if the project has a next task.

Next, we'll add a rule to the prototype for projects, that automatically sets the new attribute.

     HasNextTask=any(child,HasNextTask)

Tasks use the same boolean attribute, and the rule

    if(Badge="next"){HasNextTask=true} else {HasNextTask=false;}

Finally, an agent can gather all the projects that have no next task:

    Query:  Prototype=protoProject & HasNextTask

All this is typed by hand; there may be typos and errors.  I haven't tested it.  And I bet there's a simpler solution (and a better name for the user attribute!)
Back to top
 
 
WWW   IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: Agent for GTD-use possible?
Reply #2 - Feb 26th, 2008, 11:44am
 
Note, this is using a deprecated feature, but it still works for now.

Simply create an agent with the following AgentQuery (which assumes you have projects assigned to a prototype called "Project" feel free to remove or modify that part of the query):

Code:
Prototype=Project & !^any(child, Badge, next) 



And that's it. ^any() returns true if there are any children with the Badge attribute set to 'next', and the exclamation point prefixed means to check for only false returns.

I tried to get the following form to work:

Code:
Prototype=Project & !any(child, Badge, next) 



But that isn't working, neither does ..., Badge=next... or ..., $Badge=next... What is the preferring way to do this, now that template code is deprecated?
Back to top
 
« Last Edit: Feb 26th, 2008, 11:45am by Ioa Petra-ka »  

Av
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agent for GTD-use possible?
Reply #3 - Feb 26th, 2008, 3:25pm
 
any(child,"Badge=next") will work in actions or rules.  It can't be used in queries, though, because paranetheses in queries mean "regular expression".

A good approach might be to have a rule set a boolean user attribute HasNextAction


    HasNextAction=any(child,"Badge=next")

Now, all you have to do is look for containers where HasNextAction is false.
Back to top
 
 
WWW   IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: Agent for GTD-use possible?
Reply #4 - Feb 26th, 2008, 4:07pm
 
Mark Bernstein wrote on Feb 26th, 2008, 3:25pm:
any(child,"Badge=next") will work in actions or rules.  It can't be used in queries, though, because paranetheses in queries mean "regular expression".


That makes sense. I like to try and avoid attribute proliferation for state checking like this, but it looks like in this particular scenario it is unavoidable,  and with only one rule and one agent; pretty efficient.
Back to top
 
 

Av
  IP Logged
Pages: 1
Send Topic Print