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 efficiency: how to do big queries only once (Read 3694 times)
james a. foster
Full Member
*
Offline



Posts: 130

Agent efficiency: how to do big queries only once
Jun 17th, 2013, 1:25pm
 
I have a rather large database that contains all my professional information. One thing it has is all my "Outputs". All of these use the prototype "ProtoOutput".

I also have an agent, let's say named "/Summary/All Outputs",  that collects all the outputs with the simple query: ($Prototype=="ProtoOutput")

Now, I would like to create OTHER agents that do a further selection on outputs, but uses the children of the above agent rather than repeating that work. For example, I would like to find all the outputs that lack an end date. I create a new agent, and either my query gives me everything, or nothing. For example,

container.equals("/Summary/All Outputs")&!$EndDate or
parent.equals("/Summary/All Outputs")&!$EndDate

gives me everything, and

inside("Summary/All Outputs")&!$EndDate gives me nothing.

How do I use one agent to act on the results of another agent? (I apologize, I KNOW I've seen this before in this forum, aTBREf, or the manual, but I can't find it now.)
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agent efficiency: how to do big queries only once
Reply #1 - Jun 18th, 2013, 4:46am
 
Try testing the date argument in long form:

& $EndDate == "never"
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
james a. foster
Full Member
*
Offline



Posts: 130

Re: Agent efficiency: how to do big queries only once
Reply #2 - Jun 19th, 2013, 5:46pm
 
Still not working. Let me ask a simpler question, because I think there's something more fundamental going on.

I have an agent with Path equal to "Summary information/ALL Brags".

It uses the query ($Prototype=="ProtoOutput") and has 552 aliases under it.

I set up another agent with Path equal to "/Helpers/FixOneThing" that I want to have as it's children everything under "ALL Brags".

I use query container.equals("/Summary information/All Brags/")
And I get 1253 items (not the 552 I expected).

Same results with $Container.equals("/Summary information/All Brags/") and Container.equals("/Summary information/All Brags/"), 1253 items rather than 552.

And I get 0 items with $Container=="/Summary information/All Brags/"

I suspect I'm just not understanding how container names work with alias that come from agents. And I KNOW I saw a tip about how to do this in the TBX universe somewhere.

That is: I don't think the problem with actually with the date fields.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agent efficiency: how to do big queries only once
Reply #3 - Jun 19th, 2013, 8:13pm
 
Your problem is a missing initial slash.

    /Summary information/ALL Brags

means "ALL Brags" inside "Summary information", which is a top-level container.

    Summary information/ALL Brags

means "ALL Brags, which is inside "Summary information", which is inside this.



You are probably better off using inside(/Summary information/ALL Brags) than testing $Container.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agent efficiency: how to do big queries only once
Reply #4 - Jun 20th, 2013, 11:49am
 
See $Container. For an alias, $Container is intrinsic, and thus the alias' $Container.

If working in the context of an alias, e.g. in an agent's action, than the $Container of the original of the alias can be accessed via $Container(original). Thus, when working with an alias:

$Container           -> the container of the alias
$Container(original) -> the container of the original of the alias

Quote:
I use query container.equals("/Summary information/All Brags/")

For later readers, the above syntax doesn't exist. It would need to be coded as:

$Container == "/Summary information/All Brags/"

or possibly:

$Container(original) == "/Summary information/All Brags/"
Back to top
 
« Last Edit: Jun 20th, 2013, 11:55am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print