LibraryToggle FramesPrintFeedback

Expressions using the Simple language are typically a combination of variables and text strings that are used to create messages.

Table 14.1 shows all of the variables supported by the simple language.

Table 14.1. Simple language variable

VariableTypeDescription
exchangeIdStringThe exchange's ID value.
idStringThe In message ID value.
body Object

The In message body. Supports OGNL expressions.

in.bodyObjectThe In message body. Supports OGNL expressions.
out.body Object

The Out message body.

bodyAs(Type)TypeThe In message body, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted body can be null.
mandatoryBodyAs(Type)TypeThe In message body, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted body is expected to be non-null.
header. HeaderNameObject

The In message's HeaderName header. Supports OGNL expressions.

headers. HeaderNameObjectThe In message's HeaderName header.
in.header. HeaderNameObjectThe In message's HeaderName header. Supports OGNL expressions.
in.headers. HeaderNameObjectThe In message's HeaderName header. Supports OGNL expressions.
out.header. HeaderName Object

The Out message's HeaderName header.

out.headers. HeaderNameObjectThe Out message's HeaderName header.
headerAs(Key,Type)TypeThe Key header, converted to the specified type. All types, Type, must be specified using their fully-qualified Java name, except for the types: byte[], String, Integer, and Long. The converted value can be null.
property. PropertyName Object

The PropertyName property on the exchange.

sys.SysPropertyNameStringThe SysPropertyName Java system property.
sysenv.SysEnvVarStringThe SysEnvVar system environment variable.
exceptionStringEither the exception object from Exchange.getException() or, if this value is null, the caught exception from the Exchange.EXCEPTION_CAUGHT property; otherwise null. Supports OGNL expressions.
exception.messageStringThe exception message on the exchange or null, if no exception is set.
date:command:patternStringA date formatted using a java.text.SimpleDateFormat pattern. The following commands are supported: now, for the current date and time; header.HeaderName, or in.header.HeaderName to use a java.util.Data object in the HeaderName header from the In message; out.header.HeaderName to use a java.util.Data object in the HeaderName header from the Out message;
bean:beanRefObjectInvokes a method on the referenced bean. To specify a method name, you can either append a dot, ., followed by the method name; or you can use the ?method=methodName syntax.
properties:KeyStringThe value of the Key property placeholder.
properties:Location:KeyStringThe value of the Key property placeholder, where the location of the properties file is given by Location.
threadNameStringThe name of the current thread.

Comments powered by Disqus