camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Persisting CBR choice in body
Date Sun, 21 Dec 2014 07:08:58 GMT
Hi

No that information is currently not enriched on the exchange. The CBR
/ filter eip stores a boolean if it matched or not.

exchange.setProperty(Exchange.FILTER_MATCHED, matches);

Though we could also add another key to store the predicate itself

exchange.setProperty(Exchange.FILTER_MATCHED_PREDICATE, predicate);

Though its the runtime predicate instance, and if you want to store
some human readable detail about the predicate, the best you have is a
.toString of it.



On Fri, Dec 19, 2014 at 7:44 PM, Behrad <behradz@gmail.com> wrote:
> I want to persist which predicate of a CBR has been matched in my message
> body. Is any better way than this?
>
> from "seda:test" routeId "test" choice
> when( pred1 ) transform setBody(updatedObjectWithPred1Id ) to "somewhere"
> when( pred2 ) transform setBody(updatedObjectWithPred2Id ) to "somewhere2"
> otherwise  transform setBody(updatedObjectWithNoMatchId ) to "somewhere3"
>
> --
> --Behrad



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message