Simple 構文 ${xxx} を使用して、JSonPath 式でインライン化された Simple 言語式を使用できるようになりました。以下に例を示します。
from("direct:start")
.choice()
.when().jsonpath("$.store.book[?(@.price < ${header.cheap})]")
.to("mock:cheap")
.when().jsonpath("$.store.book[?(@.price < ${header.average})]")
.to("mock:average")
.otherwise()
.to("mock:expensive");
from("direct:start")
.choice()
.when().jsonpath("$.store.book[?(@.price < ${header.cheap})]")
.to("mock:cheap")
.when().jsonpath("$.store.book[?(@.price < ${header.average})]")
.to("mock:average")
.otherwise()
.to("mock:expensive");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<route>
<from uri="direct:start"/>
<choice>
<when>
<jsonpath>$.store.book[?(@.price < ${header.cheap})]</jsonpath>
<to uri="mock:cheap"/>
</when>
<when>
<jsonpath>$.store.book[?(@.price < ${header.average})]</jsonpath>
<to uri="mock:average"/>
</when>
<otherwise>
<to uri="mock:expensive"/>
</otherwise>
</choice>
</route>
<route>
<from uri="direct:start"/>
<choice>
<when>
<jsonpath>$.store.book[?(@.price < ${header.cheap})]</jsonpath>
<to uri="mock:cheap"/>
</when>
<when>
<jsonpath>$.store.book[?(@.price < ${header.average})]</jsonpath>
<to uri="mock:average"/>
</when>
<otherwise>
<to uri="mock:expensive"/>
</otherwise>
</choice>
</route>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
.when().jsonpath("$.store.book[?(@.price < 10)]", false, false)
.when().jsonpath("$.store.book[?(@.price < 10)]", false, false)
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<jsonpath allowSimple="false">$.store.book[?(@.price < 10)]</jsonpath>
<jsonpath allowSimple="false">$.store.book[?(@.price < 10)]</jsonpath>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow