Hi All,

I am on version 2.17 and am splitting a json document and passing bits of json 
to a processor. If the processing bean returns null, I want to keep iterating. 
If the processing bean returns a Widget, I would like to stop iterating and 
have the old exchange contain the Widget. I believe I need an aggregator to 
detect when its time to aggregate and to copy the widget from the new exchange 
to the old exchange.

The below doesn't run. Error is : Definition has no children on Aggregate[true 
-> []]. I think this is because I don't have any endpoints between aggregate 
and end.

I'm sure I'm doing something simple wrong. Any advice would be appreciated.


.split().jsonpath("$.[*]")
    .bean(WidgetProcessingBean.class)
    .aggregate(constant(true), new 
DummyAggregationStrategy()).eagerCheckCompletion()
        .completionPredicate(body().isNotNull()))
    .end()
.end()
.choice()
    .when(body().isInstanceOf(Widget.class))
        .log("Widget found")
    .otherwise()
        .log("Widget not found")
.end()

Thanks,
Geoff

=============================================================================== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=============================================================================== 

Reply via email to