Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Thanks for your reply. I tried this before, but the property "source" is then null in the next steps even if the source field was present in the XML. Really strange.. btw: Camel Version is 2.17.1 best regards -- View this message in context:

Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Hi, it found a solution which works but it is not really nice to me.. any ideas to make it smarter? .. choice().when(body().convertToString().contains("\"source\"")).setProperty("source").groovy("request.body.source").end() ... Best regards -- View this message in context:

Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Hi guys, i struggle with the following case. I have a "body" with some fields like "title", "source" etc.. Now i would like to set a Property with the value in field "source". The problem is, the field is optional, so it is not present always. It works if it is present with