Custom wire format - Relationship to the logical model

There are some restrictions for messages defined using a CWF in relation to the logical model and these are discussed below.

Composition

A CWF message is always output with the elements in the sequence specified in the logical message model definition. However, you do not always have to specify ESQL that builds the elements in that sequence. The following rules for coding ESQL are given for each value for the type Composition property.

Sequence
You must build the output message to match the sequence of the elements/groups in the message. You can normally do this is using ESQL SET statements to assign a value to each element or type. The first SET statement sets the value of the first element or type in the message, the second SET sets the value for the second element or type, and so on. You can vary this sequence of statements using ESQL ATTACH, CREATE, and MOVE statements.

If the elements or types have default values, and you do not build the message in the correct sequence, those elements built out of sequence will contain their default values, not the values that you set. This is because elements built out of sequence are assumed to be self-defining, and for CWF these are discarded when the message is written to the bit stream.

Ordered Set
You must build the output message to match the sequence of the elements in the message. You can normally do this using ESQL SET statements to assign a value to each element. The first SET statement sets the value of the first element in the message, the next SET sets the value for the second element, and so on. You can vary this sequence of statements using ESQL ATTACH, CREATE, and MOVE statements.

If the elements have default values, and you do not build the message in the correct sequence, those elements built out of sequence will contain their default values, not the values that you set. This is because elements built out of sequence are assumed to be self-defining, and for CWF these are discarded when the message is written to the bit stream.

Unordered Set
You can build elements of the output message in any sequence. On output, the elements will be written in the order specified in the logical message model definition.
All
You can build elements of the output message in any sequence. Each element must only be present once (that is, it must not repeat)
Choice
A choice cannot be resolved purely from the data. The receiving program must interpret the data and decide which option of the choice the message instance contains. This process is known as unresolved choice handling. The first reference in the application to any one of the choice elements resolves the choice to the option containing that element.
Message
In CWF, there is no way to identify, within the bitstream of an input message, which embedded message(s) appear within this input message. Mechanisms for the resolution of embedded messages is discussed in the Custom wire format - Multipart messages topic.

Type content - Content validation

CWF is a fixed format and all elements must be present in a message. Therefore, [Type Content - Content validation] is ignored. On output, all elements must be set explicitly (for example, using ESQL SET), set implicitly (using a tree copy function), or must have a default value defined.

Element - Default value

On output of a CWF message in the MRM domain, any element, or occurrence of an element for which a value has not been set (either explicitly or implicitly) inherit the element's specified default value. If no default value has been specified then an exception is thrown.

Local Element - Occurrences

When parsing or writing a CWF message in the MRM domain, any values specified for the message model properties Min Occurs and Max Occurs are ignored. The number of occurrences of an element is instead determined by either the Repeat Count or Repeat Reference property. However, the message validation functionality of WebSphere Business Integration Message Broker utilizes the Min Occurs and Max Occurs information.

Related Concepts
The message model
Custom wire format - Multipart messages

Related Tasks
Working with a message set
Working with physical properties
Adding a Custom Wire Format (CWF)
Configuring Custom Wire Format (CWF) properties: Message sets
Removing a physical format

Related Reference
Custom Wire Format physical properties for message model objects