...
Variable | Type | Description | ||
---|---|---|---|---|
id | String | the input message id | ||
body | Object | the input body | ||
in.body | Object | the input body | ||
body.OGNL | Object | Camel 2.3: the input body invoked using a Camel OGNL expression. | ||
in.body.OGNL | Object | Camel 2.3: the input body invoked using a Camel OGNL expression. | ||
bodyAs(type) | Type | Camel 2.3: Converts the body to the given type determined by its classname | ||
out.body | Object | the output body | ||
header.foo | Object | refer to the input foo header | ||
headers.foo | Object | refer to the input foo header | ||
in.header.foo | Object | refer to the input foo header | ||
in.headers.foo | Object | refer to the input foo header | ||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="32d532f17c5c7f10-392bcbe5-46954027-b29a9f86-8328984013e5e0c4610ad18a"><ac:plain-text-body><![CDATA[ | header.foo[bar] | Object | Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="117de24f54e1a0dc-1733ff1d-4f9f45b1-a68b9db7-ec76ea47f9f8286c10c00aec"><ac:plain-text-body><![CDATA[ | in.header.foo[bar] | Object | Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b630d63519ae361d-87dd324f-48304945-94129cb0-45a7dc192cf50820ec9a0e76"><ac:plain-text-body><![CDATA[ | in.headers.foo[bar] | Object | Camel 2.3: regard input foo header as a map and perform lookup on the map with bar as key | ]]></ac:plain-text-body></ac:structured-macro> |
header.foo.OGNL | Object | Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression. | ||
in.header.foo.OGNL | Object | Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression. | ||
in.headers.foo.OGNL | Object | Camel 2.3: refer to the input foo header and invoke its value using a Camel OGNL expression. | ||
out.header.foo | Object | refer to the out header foo | ||
out.headers.foo | Object | refer to the out header foo | ||
property.foo | Object | refer to the foo property on the exchange | ||
sys.foo | String | refer to the system property | ||
sysenv.foo | String | Camel 2.3: refer to the system environment | ||
exception.message | String | Camel 2.0. Refer to the exception.message on the exchange, is null if no exception set on exchange. Will fallback and grab caught exceptions ( | ||
date:command:pattern | String | Camel 1.5. Date formatting using the | ||
bean:bean expression | Object | Camel 1.5. Invoking a bean expression using the Bean language. Specifying a method name you must use dot as separator. In Camel 2.0 we also support the ?method=methodname syntax that is used by the Bean component. | ||
properties:locations:key | String | Camel 2.3: Lookup a property with the given key. The |
...
Code Block |
---|
simple("${body.address.lines[0]}")
simple("${body.address.lines[1]}")
simple("${body.address.lines[2]}")
|
There is a special last
keyword which can be used to get the last value from a list.
Code Block |
---|
simple("${body.address.lines[last]}")
|
And to get the 2nd last you can subtract a number, so we can use last-1
to indicate this:
Code Block |
---|
simple("${body.address.lines[last-1]}")
|
And the 3rd last is of course:
Code Block |
---|
simple("${body.address.lines[last-2]}")
|
And yes you can combine this with the operator support as shown below:
...