Configuring the message model

This topic describes how to configure the message model, and includes the following sections:

Configuring properties of the Address message definition

Some objects, such as elements, have both properties that are associated with them as standalone objects, and properties that are associated with them as members of another object (such as a type, or a group). This topic lists these properties in two tables:

The tables list only the properties that are set in this sample. Many more properties are available, but in this sample most are left to their default values.

Configuring properties of objects as standalone objects

To configure the properties of the objects as standalone objects (such as elements), set the properties as listed in the table below:

  1. Switch to the Broker Application Development perspective.
  2. In the Broker Development view, double-click Address.mxsd to open it.
  3. In the Outline view, expand the folders to find the object you require, and click the object to highlight it. For example, for {Local complexType}, expand Elements and Attributes > Address, then click {Local complexType}.
  4. In the Message Definition editor, click the Properties tab.
  5. In the Properties Hierarchy, find the properties you want to configure. For example, to configure the TDS properties for {Local complexType}, click Physical properties > TDS1 > Complex Type. If you are configuring the properties of a local element, a global element, an element reference, or a group reference, click Physical properties > TDS1 > Local Element/Global Element/Element Reference/Group Reference respectively.
  6. Set the properties as shown in the table below.
    Object Logical properties CWF properties XML properties TDS properties
    Town        
    Street        
    HouseNo        
    {Local complexType} Composition = orderedSet     Data Element Separation = Tagged Delimited
    Group Indicator = [
    Group Terminator = ]
    Delimiter = *
    Tag Data Separator = :

Composition for {Local complexType} is set to OrderedSet because the elements must appear in order. Alternatively, Composition could be set to Sequence. When Composition is set to OrderedSet, elements appear in order, and cannot be duplicated. When Composition is set to Sequence, elements still appear in order, but can be duplicated. A duplicate element is an element included more than once anywhere within the complex type.

The other logical properties for {Local complexType} are left to take their default values. The default setting for Content Validation is Closed; this means that the complex type {Local complexType} can contain only the elements that are its members. If Content Validation was set to Open, this complex type could contain any element, and not just those defined in this message set.

Data Element Separation is set to Tagged Delimited to demonstrate different types of data element separation. Use the links at the end of this topic to find out more about different data element separation settings.

Configuring properties of objects as members of other objects

To configure the properties of the objects as members of other objects (such as types, or groups), set the properties as listed in the table below:

  1. Switch to the Broker Application Development perspective.
  2. In the Broker Development view, double-click Address.mxsd to open it.
  3. In the Outline view, expand the navigation tree to find the object you require, and click the object to highlight it. In the tree, select the object under the object it is a member of. For example, for Town, expand Elements and Attributes > Address > {Local complexType}, then click Town.
  4. In the Message Definition editor, click the Properties tab.
  5. In the Properties Hierarchy, find the properties that you want to configure. For example, to configure the TDS properties for Town, click Physical properties > TDS1 > Local Element.
  6. Set the properties as shown in the table below:
    Object Member of Logical properties CWF properties XML properties TDS properties
    Town Address > {Local complexType}   Length count = 20    
    Street Address > {Local complexType}   Length count = 20    
    HouseNo Address > {Local complexType}   Length count = 4
    Physical Type = External Decimal
    'Signed' check box = not selected
    String Justification = Left Justify
    Padding Character = SPACE
       
    {Local complexType} Address        

 

Configuring properties of the Borrowed message definition

Some objects, such as elements, have two sets of properties: those that are associated with the objects as standalone objects, and those that are associated with objects as members of another object (such as a type, or a group). This topic lists these properties in two tables:

The tables list only the properties that are set in this sample. Many more properties are available, but in this sample most are left to take their default values.

Configuring properties of objects as standalone objects

To configure the properties of the objects as standalone objects (such as elements), set the properties as shown in the table below. Use the instructions in the previous section, Configuring properties of the Address message definition.

Object Logical properties CWF properties XML properties TDS properties
VideoTitle        
DueDate        
Cost        
{Local complexType}    

 

Data Element Separation = All Elements Delimited
Group Indicator = [
Group Terminator = ]
Delimiter = *

You do not need to set any logical properties for {Local complexType}, as these are left to take their default values. Data Element Separation is set to All Elements Delimited to demonstrate different types of data element separation. For more information about how All Elements Delimited differs from Tagged Delimited, see Data element separation.

Configuring properties of objects as members of other objects

To configure the properties of the objects as members of other objects (such as types, or groups), set the properties as shown in the table below. Use the instructions in the previous section, Configuring properties of the Address message definition.

Object Member of Logical properties CWF properties XML properties TDS properties
VideoTitle Borrowed > Anonymous   Length Count = 20 Render = XMLAttribute  
DueDate Borrowed > Anonymous   Length Count = 10
DateTime Format = yyyy-MM-dd
  DateTime Format = yyyy-MM-dd
Cost Borrowed > Anonymous   Length Count = 4    
{Local complexType} Borrowed        

The rendering option for VideoTitle is set to XMLAttribute to demonstrate different ways of configuring the message model. Creating VideoTitle as an element and rendering it as an attribute is just one possible way of configuring the object. VideoTitle could be configured in any of the following ways:

In the last two options, VideoTitle appears in exactly the same form in the message. That is, you can achieve the same result by either configuring the object as an attribute, or configuring it as an element rendered as an attribute. Rendering options can be used if you need to, for example, change an element into an attribute (or vice versa) after the object has been created, but there are other reasons for using different rendering options. For example, there might be business reasons for creating several elements with the same name, and then using rendering options to give them different identifiers.

Configuring properties of the Customer message definition

Some objects, such as elements, have two sets of properties: those that are associated with the objects as standalone objects, and those that are associated with objects as members of another object (such as a type, or a group). This topic lists these properties in two tables:

The tables list only the properties that are set in this sample. Many more properties are available, but in this sample most are left to take their default values. For more information, use the links at the end of this topic.

Configuring properties of objects as standalone objects

To configure the properties of the objects as standalone objects (such as elements), set the properties as shown in the table below. Use the instructions in the previous section, Configuring properties of the Address message definition.

Object Logical properties CWF properties XML properties TDS properties
FirstName       Tag = FirstName
LastName       Tag = LastName
Title       Tag = Title
NameType Composition = orderedSet
Content Validation = Open
   

Data Element Separation = Tagged Delimited
Group Indicator = [
Group Terminator = ]
Delimiter = *
Tag Data Separator = :

ID       Tag = ID
CreditCardNo       Tag = CreditCardNo
DrivingLicenseNo       Tag = DrivingLicenseNo
PassportNo       Tag = PassportNo
IdGroup Composition = Choice
Content Validation = Closed
    Data Element Separation = Tagged Delimited
Delimiter = &
Tag Data Separator = :
brw:Borrowed        
Magazine       Tag = Magazine
CustomerType Composition = Sequence
Content Validation = Open
    Data Element Separation = Tagged Delimited
Group Indicator = {
Group Terminator = }
Delimiter = &
Tag Data Separator = :

Setting the Content Validation of NameType to Open means that duplicate elements are not allowed, but other elements that are not defined in this type are allowed. A duplicate element is an element included more than once anywhere within the complex type. Content Validation for NameType is set to Open to demonstrate another Content Validation option.

Composition of NameType is set to OrderedSet because the elements must appear in order. Alternatively, Composition could be set to Sequence. Sequence is the default value for Composition, and is used, for example, for CustomerType. When Composition is set to OrderedSet, elements appear in order, and cannot be duplicated. When Composition is set to Sequence, elements still appear in order, but can be duplicated.

Setting Composition of IdGroup to Choice means that you can now choose only one of PassportNo, DrivingLicenseNo, or CreditCardNo as the type of identifier used as proof of identity when a customer opens an account with the video store. Setting Content Validation to Closed means that you can only choose from these three options. For example, if Content Validation was set to Open Defined, you could choose other elements defined within your message set.

Use the links at the end of this topic to find out more.

Configuring properties of objects as members of other objects

To configure the properties of the objects as members of other objects (such as types, or groups), set the properties as shown in the table below. You must perform all the configuration tasks listed in the table below in the Customer.mxsd message definition file. Remember that you must select the object under the object of which it is a member. Use the instructions in the previous section, Configuring properties of the Address message definition.

Object Member of Logical properties CWF properties XML properties TDS properties
FirstName NameType   Length Count = 20 Repeat Count = 1    
LastName NameType   Length Count = 20 Render = XMLAttribute  
Title NameType   Length Count = 3 Repeat Count = 1    
NameType Customer        
ID CustomerType   Length Count = 1
Repeat Count = 1
   
CreditCardNo IdGroup Min Occurs = 0 Length Count = 20  

 

DrivingLicenseNo IdGroup Min Occurs = 0 Length Count = 20    
PassportNo IdGroup Min Occurs = 0 Length Count = 20    
IdGroup          
brw: Borrowed CustomerType Min Occurs = 0
Max Occurs = 3
Repeat Count = 2   Repeating Element Delimiter = *
Magazine CustomerType Min Occurs = 0      
CustomerType          

The rendering option for LastName is set to XMLAttribute to demonstrate different ways of configuring the message model. This was also the case for VideoTitle in the previous section, Configuring properties of the Borrowed message definition.

For the object brw:Borrowed, the repeat count for CWF is set to 2 to reflect the number of videos borrowed, as indicated in the input message. Because the XML and TDS formats use delimiting tags to show where each repeat starts and finishes, you do not need to specify a repeat count for XML and TDS. If it was the case that you did not know in advance how many times a repeating element would repeat, you would have to include an additional integer field in the message model, use ESQL to populate this field dynamically with the number of repeats, change Repeat Count to Repeat Reference, and put in a reference to the value of that integer field.

Configuring the Boolean values for Magazine

Because the element Magazine is of type 'boolean', you must also configure the Boolean values used throughout the message set. To set the Boolean values:

  1. Switch to the Broker Application Development perspective.
  2. In the Broker Development view, double-click messageSet.mset. This file contains the default values used throughout the message set.
  3. In the Message Set editor view, under Physical properties, click CWF1.
  4. Set the Boolean values, under Binary representation of Boolean values, as listed in the table below.
    Property Value
    Boolean True Value 31
    Boolean False Value 30
    Boolean Null Value 00

 

Back to sample home