IBM Integration Bus, Version 10.0.0.17 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


MRM Custom wire format: Relationship to the logical model

Some restrictions exist in relation to the logical model for messages that are defined by using the CWF.

Composition

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

Sequence
You must build the output message to match the sequence of the elements or groups in the message. You can normally do this 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 statement sets the value for the second element or type, and so on. You can vary this sequence of statements by 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 that are built out of sequence contain their default values, not the values that you set. This is because elements that are 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 statement sets the value for the second element, and so on. You can vary this sequence of statements by 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 that are built out of sequence contain their default values, not the values that you set. This is because elements that are 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 are written in the order that is specified in the logical message model definition.
All
You can build elements of the output message in any sequence. Each element must be present only once (that is, it must not repeat). On output, the elements are written in the order that is specified in the logical message model definition.
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 that contains that element.
Message
Mechanisms for the resolution of embedded messages are discussed in the MRM Custom wire format: Multipart messages topic.

Content validation

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

Default values

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), inherits the specified default value of the element. If no default value has been specified then an exception is thrown.

Min Occurs and Max Occurs

The logical properties Min Occurs and Max Occurs specify the permitted number of occurrences of an element, or group, in a message. These properties are used when parsing and writing messages, and when validating the content of a message.

In CWF, Max Occurs occurrences are expected when parsing, and Max Occurs occurrences are produced when writing. Default values are used for missing elements, and any excess elements are discarded.

These rules arise because, in a CWF message format, there are no tags or other markup that can be used to determine the end of a variable number of repeats.

However this behavior is overridden if the CWF property Repeat Reference is set, which indicates that the number of occurrences is given instead by an integer element that occurs earlier in the message. In this case Max Occurs is ignored.

When validating, Min Occurs and Max Occurs are both used to check that the content of the message tree matches the model.

Simple types - lists and unions

Lists and unions are XML-specific concepts. An element or attribute of a simple type that is a list or a union causes a task list warning if a CWF physical format is present in the message set. The user can choose whether to make this an error, warning, or information by editing the Validation preferences. The dictionary generator omits messages defined to contain such elements or attributes from the CWF section of the dictionary.


ad10490_.htm | Last updated 2019-07-13 08:12:29