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
 
 
				次のように、オプション allowSimple を false に設定して、インライン化された Simple 式のサポートを無効にすることができます。
			
.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