Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1280D6A51 for ; Fri, 15 Jul 2011 20:28:53 +0000 (UTC) Received: (qmail 52399 invoked by uid 500); 15 Jul 2011 20:28:52 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 52261 invoked by uid 500); 15 Jul 2011 20:28:52 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 52253 invoked by uid 99); 15 Jul 2011 20:28:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 20:28:51 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2011 20:28:46 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Qhozc-0004YC-Fh for users@camel.apache.org; Fri, 15 Jul 2011 13:28:12 -0700 Date: Fri, 15 Jul 2011 13:28:12 -0700 (PDT) From: boday To: users@camel.apache.org Message-ID: <1310761692479-4592073.post@n5.nabble.com> In-Reply-To: <1310737355850-4590722.post@n5.nabble.com> References: <1310737355850-4590722.post@n5.nabble.com> Subject: Re: RouteBuilder Predicate Syntax MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit #1 is correct, you should explicitly call end() after each choice() block... enalposi wrote: > > [Camel 2.7.2] > > Sorry, but I am not quite clear about the syntax of inserting Predicates, > esp to dynamically wire in processors... I am also not sure about the > significance of end() and the newer endChoice(). Basically, doing 1 choice > seems to be working but 2, as in below examples, breaks the continuation > of the route "to". > > I am trying to build something along the line of: > - if predicate 'condition1' is true go through processor1 otherwise skip > to the next > - if predicate 'condition2' is true go through processor2 regardless of > condition1 > - after evaluation of the predicates, join back into a common route > definition segment. > > Example: > > from("in"). > choice().when(condition1).process(processor1).end(). > choice().when(condition2).process(processor2).end(). > to("to"); > > OR > > > from("in").choice(). > when(condition1).process(processor1). > when(condition2).process(processor2). > end().to("to"); > > > Hope I was able to explain my issue :) > > Thanks! > ----- Ben O'Day IT Consultant -http://consulting-notes.com -- View this message in context: http://camel.465427.n5.nabble.com/RouteBuilder-Predicate-Syntax-tp4590722p4592073.html Sent from the Camel - Users mailing list archive at Nabble.com.