Writing ESQL
How you can use ESQL to customize nodes.
About this task
When you create a message flow, you include input nodes that receive the messages and, optionally, output nodes that send out new or updated messages. If required by the processing that must be performed on the message, you can include other nodes after the input node that complete the actions that your applications need.
Some of the built-in nodes enable you to customize the processing that they provide. The Compute, Database, DatabaseInput, and Filter nodes require you to provide a minimum level of ESQL, and you can provide much more than the minimum to control precisely the behavior of each node. This set of topics discusses ESQL and the ways in which you can use it to customize these nodes.
You can use the Mapping node to customize the processing visually. You can also call ESQL from a map to process or reuse existing or common ESQL routines. For more information, see Using message maps
ESQL provides a rich and flexible syntax for statements and functions that enable you to check and manipulate message and database content. You can:
- Read the contents of the input message
- Modify message content with data from databases
- Modify database content with data from messages
- Construct new output messages created from all, part, or none of the input message (in the Compute node only)
The following topics provide more information about these and other tasks that you can perform with ESQL. Unless otherwise stated, these guidelines apply to messages in all message domains except the BLOB domain, for which you can implement a limited set of actions.
- Tailoring ESQL code for different node types
- Manipulating message body content
- Manipulating other parts of the message tree
- Transforming from one data type to another
- Interaction with databases using ESQL
- Coding ESQL to handle errors
- Configuring a message flow at deployment time with user-defined properties
- Accessing a user-defined policy by using ESQL
The following topics provide additional information specific to the parser that you have specified for the input message:
- Manipulating messages in the DFDL domain
- Manipulating messages in the XML domain
- Manipulating messages in the MRM domain
- Manipulating messages in the JMS domains
- Manipulating messages in the XMLNS domain
- Manipulating messages in the XMLNSC domain
- Manipulating messages in the IDOC domain
- Manipulating messages in the MIME domain
- Manipulating messages in the BLOB domain
- Manipulating messages in the JSON domain
ESQL examples
About this task
Most of the examples included in the topics listed previously show parser-independent ESQL. If examples include a reference to MRM, they assume that you have modeled the message in the MRM and that you have set the names of the MRM objects to be identical to the names of the corresponding tags or attributes in the XML source message. Some examples are also shown for the XML domain. Unless stated otherwise, the principals illustrated are the same for all message domains. For domain-specific information, use the appropriate link in the previous list.
Most of the topics that include example ESQL use the ESQL sample message, Invoice, as the input message to the logic. This message is provided in XML source format (with tags and attributes), see Example message. The example message is shown in the following diagram.
A few other input messages are used to show ESQL that provides function on messages with a structure or content that is not included in the Invoice or Video samples. Where this occurs, the input message is included in the topic that refers to it.