Accessing the Properties tree

The Properties tree has its own correlation name, Properties, and you must use this in all ESQL statements that refer to or set the content of this tree.

The fields in the Properties tree contain values that define the characteristics of the message. For example, the Properties tree contains a field for the message domain, and fields for the encoding and CCSID in which message data is encoded. For a full list of fields in this tree, see Data types for elements in the Properties subtree.

You can interrogate and update these fields using the appropriate ESQL statements. If you create a new output message in the Compute node, you must set values for the message properties.

Setting output message properties

If you use the Compute node to generate a new output message, you must set its properties in the Properties tree. The output message properties do not have to be the same as the input message properties.

For example, to set the output message properties for an output MRM message, set the following properties:

Property Value
Message Domain MRM
Message Set Message set identifier
Message Type Message name¹
Message Format Physical format name²
Notes:
  1. If you are using multipart messages, refer to Multipart messages for details of how MessageType is used.
  2. The name that you specify for the physical layer must match the name that you have defined for it. The default physical layer names are CWF1, XML1, and TDS1.

This ESQL procedure sets message properties to values passed in by the calling statement. You might find that you have to perform this task frequently, and you can use a procedure like this in many different nodes and message flows. If you prefer, you can code ESQL that sets specific values.

CREATE PROCEDURE setMessageProperties(IN OutputRoot REFERENCE, IN setName char,
                 IN typeName char, IN formatName char) BEGIN
	/****************************************************************************
	* A procedure that sets the message properties
	****************************************************************************/
	set OutputRoot.Properties.MessageSet    = setName;
	set OutputRoot.Properties.MessageType   = typeName;
	set OutputRoot.Properties.MessageFormat = formatName;
END;

To set the output message domain, you can set the message property, or you can code ESQL statements that refer to the required domain in the second qualifier of the SET statement, the parser field. For example, the ESQL statement sets the domain to MRM:

SET OutputRoot.MRM.Field1 = 'field1 data';

This ESQL statement sets the domain to XML:

SET OutputRoot.XML.Field1 = 'field1 data';

Do not specify more than one domain in the ESQL for any single message. However, if you use PROPAGATE statements to generate several output messages, you can set a different domain for each message.

For information about the full list of elements in the Properties tree, see Data types for elements in the Properties subtree.