Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 96121 invoked from network); 17 Feb 2005 16:12:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 16:12:35 -0000 Received: (qmail 35582 invoked by uid 500); 17 Feb 2005 16:12:33 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 35406 invoked by uid 500); 17 Feb 2005 16:12:32 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 35381 invoked by uid 99); 17 Feb 2005 16:12:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from sccrmhc11.comcast.net (HELO sccrmhc11.comcast.net) (204.127.202.55) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 17 Feb 2005 08:12:30 -0800 Received: from [192.168.2.102] (maximus.jgsullivan.com[68.79.151.2]) by comcast.net (sccrmhc11) with ESMTP id <20050217161226011006tj38e>; Thu, 17 Feb 2005 16:12:28 +0000 Mime-Version: 1.0 Message-Id: In-Reply-To: <0b9001c514ac$8636dcc0$34000a0a@auburn> References: <2387fbc505021605081d80ca7a@mail.gmail.com> <0b9001c514ac$8636dcc0$34000a0a@auburn> Date: Thu, 17 Feb 2005 10:11:38 -0600 To: "James Mitchell" , "Jakarta Commons Developers List" From: Joe Germuska Subject: Re: [chain] LookupCommand's return value Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N At 11:52 PM -0500 2/16/05, James Mitchell wrote: >I'm just now catching up on some of this....but I was >wondering.....if you configure "ignoreReturnValue" or >"abortIfContextValueTrueOrNull" or "whatchaMaCallit", then how would >you (in a looked up chain) tell the calling chain to abort without >having to throw an exception? When a command returns false, that is intended as a sign to its caller that it thinks it has "finished". ChainBase interprets a "true" return from a command as a sign to stop executing the chain. It also returns whatever it received from the last command it executed, so the fundamental design denies the possibility of autonomous subchains and commands. I can see where this would sometimes be the way you'd want it, but I think that if it's the only way, one must configure chains relatively obtusely in order to ensure that conditional commands never get called, or, as in Struts, one must burden commands with more contextual knowledge than they should have -- there's absolutely no reason an "ExecuteAction" command should care if the form was valid or not; something else should prevent it from being called in that case. I thought an "abort chain" command was a good idea, but it doesn't work in the current design. The alternative is to relegate the "only-if-validation-passed" commands to their own sub-chain which only gets executed if validation passed. So for now, I think the best strategy is a variant of LookupCommand which branches: perhaps generically implemented with a context key name to look up a boolean value and then configured with a "true" command, a "false" command, and perhaps a "null" command. That one would be a lot tidier with the not-yet-released Chain functionality to specify a catalog/command pair with a single String. Is it time to roll a 1.0.1 (or 1.1.) commons-chain release? Is there anything else which should maybe go in it? Joe -- Joe Germuska Joe@Germuska.com http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org