camel expression syntax
camel expression syntax
https://help.sap.com/docs/integration-suite/sap-integration-suite/using-camel-simple-expression-language?q=camel%20expression
Cloud Integration supports a subset of the expressions defined in Camel Simple Expression Language (see https://camel.apache.org/components/next/languages/simple-language.html ).
You can use Camel Simple Expression Language when configuring the following components:
Component | Use Camel Simple Expression to ... | More Information |
---|---|---|
Content modifier | Define:
(Type parameter set to Expression) | |
Write variables | Define a variable. (Type parameter set to Expression) | |
Router | Define a routing condition. (Expression Type parameter set to Non-XML) | |
Content filter | Define conditions for XPath elements. To review some examples, see Examples. |
Expressions Supported by Content Modifier and Write Variables Step
The following table lists the expressions from Camel Simple Expression Language that are supported by the content modifier and write variables step.
Expression | Description | Example |
---|---|---|
exchangeId | Exchange Id. | ${exchangeId} |
id | Message Id | ${id} |
body | Incoming message body | ${body} |
in.body | Incoming message body | ${in.body} |
bodyAs(<class> | Message body converted to compatible class | ${bodyAs(String)} |
mandatoryBodyAs(<class>) | Message body is Mandatory converted to compatible class | ${mandatoryBodyAs(String)} |
in.header.fo | Refers to foo (forward declaration) in header | ${in.header.mandatory.length} |
in.header.foo.OGNL | Refers to foo (forward declaration) in header with OGNL (Object-Graph Navigation Language) expresssion | ${in.header.fname.split(',')[0]} |
headerAs(<key>,<class> | Refers to header with name <key> converted to compatible class | ${headerAs(name, String)} |
property.foo | Refers to foo (forward declaration) in exchange property | ${property.token.length} |
property.foo.OGNL | Refers to foo (forward declaration) in exchange property with OGNL (Object-Graph Navigation Language) expresssion | ${property.token.split(',')[0]} |
sys.foo | Refers to foo (forward declaration) in system (runtime container) | ${sys.file.separator} |
sysenv.foo | Refers to foo (forward declaration) in system enviroment | ${sysenv.property1} |
date:<command>:<pattern> | Creates date specified in command and uses SimpleDateFormat notation | Processed at ${date:now-2h} Othe rexample: To write the current timestamp into a message header, define a header with the following value (and Type set to Expression): ${date:now:yyyy-MM-dd HH:mm:ss} |
date-with-timezone:<command>:<timezone>:<pattern> | Same as date, but with timezone | Expires at ${date-with-timezone:now+2h30m:IST:yyyy-MM-dd'T'HH:mm:ss.SSSZ} |