If you look at the jsonpath documentation you can see there is a not equals
operator you can use.
https://github.com/jayway/JsonPath
But for your case, can you not just write:
.when().jsonpath("$.table.length()>0")
On Wed, Mar 22, 2017 at 4:21 PM, rafaeltuelho [via Camel] <
[email protected]> wrote:
> Sorry, it appears my code snippet was not shown in the original message:
>
> Here it is:
>
> .choice()
> .when().jsonpath("$.table[?(@.rows size 0)]") <<<-- I need to negate
> HERE!!! or something like size > 0
> .log("rows returned: " + simple("${body}"))
> .otherwise()
> .log("no rows returned!!!")
> .endChoice()
>
>
> ________________________
> Rafael Torres Coelho Soares
>
> On Wed, Mar 22, 2017 at 12:17 PM, rafaeltuelho <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5795866&i=0>> wrote:
>
> > Hi.
> >
> > How can I negate a Jsonpath expression in when() clause?
> >
> > Actually I need to test if a returned json body has a given array not
> > empty... I coulnd not find a valid JSON expression to do this...
> >
> > I'm using this:
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://camel.465427.n5.nabble.
> > com/jsonpath-expressions-in-when-clause-tp5795865.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/jsonpath-expressions-in-
> when-clause-tp5795865p5795866.html
> To start a new topic under Camel - Users, email
> [email protected]
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context:
http://camel.465427.n5.nabble.com/jsonpath-expressions-in-when-clause-tp5795865p5795917.html
Sent from the Camel - Users mailing list archive at Nabble.com.