placeholder expressions

Placeholder Expressions

Version: 17.07

Developer Guide

Overview

Placeholder expressions provides a convenient way of extracting message context and message details in String format using a set of string placeholders. These place holder strings can be used as arguments to text inputs fields in processing elements that support data extraction from placeholder expressions.

Depending on the processing element, all or some of the expressions placeholders will be supported and again depending on the processing element, it may support a combination of place holder expressions or a single place holder expressions at a time. Details on whether a processing element supports this place holder expressions or not can be found in the parameters section in each processing element documentation.

Expressions

Currently supported expression placeholders are follows.

Message Related Place Holder Expressions

@{message.headers.<header_name>}

Extracts the message header represented by the given header name. Note that <header_name> must be replaced with a transport header name. i.e @{message.headers.Content-Type}.

If the requested header is not found, a string with the text "null" will be returned.

Message header names are case sensitive like all Java Variables). Therefore exact case of message header name should be used.

@{message.headers}

Extract all the message headers.

@{message.properties.<property_name>}

Extracts the message property represented by the given property name. Note that <property_name> must be replaced with a property name. i.e @{message.properties.M-PROP-1}

If the requested message property is not found, a string with the text "null" will be returned.

Message property names are case sensitive like all Java Variables). Therefore exact case of message property name should be used.

@{message.properties}

Extract all the message headers

@{message.payload}

Extracts the message payload. If there is no payload in the current message, then a string with the text "null" will be returned.

@{message.id}

Extracts the message id

Message Context Related Place Holder Expressions

@{mc.properties.<property_name>}

Extracts the message context property represented by the given property name. Note that <property_name> must be replaced with a message context property name. i.e @{mc.properties.MC-PROP-1}

If the requested message context property is not found, a string with the text "null" will be returned.

Message context property names are case sensitive like all Java Variables). Therefore exact case of message context property name should be used.

@{mc.properties}

Extract all the message context headers

@{mc.id}

Extracts the message context id

Scope Variables Related Place Holder Expressions

@{variable.<variable_name>}

Extracts the scope variable represented by the given variable name. Note that <variable_name> must be replaced with a scope variable name. i.e @{variable.MY_VAR}

If the requested scope variable is not found, a string with the text "null" will be returned.

Scope variable names are case sensitive like all Java Variables). Therefore exact case of scope variable name should be used.

@{current.variable.<variable_name>}

Extracts the scope variable represented by the given variable name from the current scope context. If the variable is not found "null" (string) will be returned. It is important to note that in this case the variable will only be searched in the current scope context and the variable search will not be propagated to parent scope context.

If the requested scope variable is not found in the current scope, a string with the text "null" will be returned.

Exception Related Place Holder Expressions

@{last.exception}

Extracts the message of the last exception occurred. Note that it is advised to use this in an exceptional path in the flow. Otherwise there can be cases where there may not be a last exception and "null" (string) will be returned.

Current Timestamp Based Place Holder Expressions

@code @{current.timestamp}

Returns current timestamp formatted according to the default timestamp pattern "yyMMddHHmmssZ"

@code @{current.timestamp.<timestamp_pattern>}

Returns the current timestamp formated with the given timestamp pattern. Note that timestamp pattern given here should be a pattern compatible with SimpleDateFormat.

If the given timestamp pattern is invalid, the default timestamp pattern "yyMMddHHmmssZ" will be used.

In this topic
In this topic
Contact Us