Adding a Field to a Message Definition

A message definition is defined by its fields and containers. A field models a data element, for example, a postal code. A container can contain fields and other containers.

To add a field to a message definition:

  1. In the WorkSpace Navigator of the Service Development perspective, expand the project that contains the message definition you want to work with.

  2. Expand MessageDesigns, then expand MessageDefinitions.

  3. Double-click the message definition. The message definition has a .wfm extension.

    The message definition opens in the Message Definition Editor.

  4. Select the Message Details tab.

  5. Do one of the following:

    • To add a field to the message definition at the root level, right-click the root, or top, element in the Message Definition section and select New Child|Field from the context menu.

    • To add a field inside a container, right-click the container in the Message Definition section and select New Child|Field from the context menu.

    • To insert a field directly before a container or field, at the same level in the tree, right-click the container or field in the Message Definition section and select Insert|Field from the context menu.

    The field is added to the tree. The Field Properties section displays default field properties.

  6. (Optional) To move the field, drag and drop the field to the correct location in the tree.

    When you drag the field, a horizontal line appears, indicating the new location.

  7. In the Field Properties section, edit the settings using the following table.

    Note

    In each container, the Repeat Type, Node Type, and Termination Type properties have subproperties, which are described in Subproperties column.

    Field properties

    Field propertyOptionsSubproperties

    Name

    For example, ZIP code.

    For more information, see Troubleshooting Message Definition Objects.

    Optional

    Select whether or not this field must occur in each message:

    True

    This field can be present or absent from a message.

    False

    Each message has at least one of these fields.

    Repeat Type

    Select the rule that determines how many fields of this type are expected to occur in each message:

    None

    This field always occurs once and only once.

    Unbounded

    For each message, this field can occur any number of times or not at all.

    Fixed Count

    This field occurs X number of times in each message, where X = Instances.

    Instances

    Enter the fixed number of times this field occurs in series, for example, 4.

    Field Driven

    This field appears X number of times, where X = the positive integer value of the field specified by Instance Count Field.

    Instance Count Field

    Select the field, which you must first create elsewhere in this message definition, containing the integer value that specifies how many times this field occurs in series, for example, \MsgDef01\SomeContainer\Iterations. This value can vary for each message.

    Note

    Before you can select a Repeat Count Field, you must create a suitable numeric field in the message definition, for example, IterationsOfSomeOtherField. The Repeat Count Field can be located anywhere in the message definition.

    Range

    This field may appear any number of times between and including X and Y, where X is the value of Min and Y is the value of Max.

    Min

    Enter the minimum number of times this field can occur in series, for example, 1.

    Max

    Enter the maximum number of times this field can occur in series, for example, 32.

    Node Type

    Select whether the node consists of data, a literal tag, or both, and if the data conforms to a specified length:

    Data Only

    The data occurs by itself with no tag, for example, 90210.

    Tag & Data

    The data is preceded by a tag identifying the field, for example, TAGZIP:90210.

    After you select the Tag Data option, set its subproperties:

    Tag Value

    Click . . . to define the tag that identifies this field.

    Tag, Length & Data

    The data is preceded by a tag identifying the field and a numeric value indicating the fixed length of the data.

    After you select the Tag Length Data option, set its subproperties:

    Tag Value

    Click . . . to define the tag that identifies this field.

    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    Note

    You must set the Unit property to Byte if the following two conditions are both true:

    • The field's Data Type property is set to Binary.

    • The field's Node Type property is set to one of the following options:

      • Tag Length & Data

      • Length, Tag & Data

      • Length & Data

    Data Type

    Select the datatype of the data element that defines the field length. For complete definitions, refer to the list of supported datatypes.

    Termination Type

    Select the method used to identify the end of the length data using the Length Termination Type table.

    Length, Tag & Data

    The data is preceded by a numeric value indicating the fixed length of the data and a tag identifying the field.

    After you select the Length Tag Data option, set its subproperties:

    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    Data Type

    Select the format of the data element that defines the field length. For complete definitions, refer to the list of supported datatypes.

    Termination Type

    Select the method used to identify the end of the length data using the Length Termination Type table.

    Tag Value

    Click . . . to define the tag that identifies this field.

    Length & Data

    The data is preceded by a numeric value indicating the fixed length of the data.

    After you select the Length Data option, set its subproperties:

    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    Data Type

    Select the format of the data element that defines the field length. For complete definitions, refer to the list of supported datatypes.

    Termination Type

    Select the method used to identify the end of the length data using the Length Termination Type table.

    Literal

    This field contains no data, only a literal value, for example, USDOLLARS.

    After you select the Literal option, set its subproperty:

    Literal Value

    Click . . . to define the string or binary constant tag for this field.

    Note

    The literal value of a literal field must be a valid value for the literal field's datatype. For example, a literal field that has a binary literal value must have a binary datatype.

    Data Type

    Select the datatype of the data element. For complete definitions, refer to the list of supported datatypes.

    Termination Type

    Select an option to specify how the end of the field is identified:

    End of Container

    The field accepts input until the end of its container or the end of the message.

    Delimiter

    The end of the field is marked by a character string or binary sequence:

    Delimiter Value

    For example, a semicolon ;

    Fixed Length

    For all message instances, the field length is defined by an integer value.

    Length For example, 16.
    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    Minimum Length & White Space

    A minimum number of characters are read from the field, continuing until whitespace data is read, including spaces, carriage returns, line feeds, horizontal tabs, or vertical tabs.

    Length

    For example, 16.

    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    Minimum Length & Delimiter

    A minimum number of characters are read from the field, continuing until a delimiter is reached.

    Delimiter Value

    For example, a semicolon ;

    Length

    Enter the minimum length of the field, for example, 96.

    Unit

    Select Character if Length is entered in characters or select Byte if Length is entered in bytes.

    White Space

    The end of the field is marked by whitespace data, including spaces, carriage returns, line feeds, horizontal tabs, or vertical tabs.

    Custom Parse Extension

    Click ... to select a JAR and class to perform custom post-parse manipulation of this field at runtime. By definition, this routine is called after any initial parsing of the field.

    The custom class must reside in a JAR that you have developed and imported to the CustomClasses folder in your project.

    Custom Field Parser

    Click ... to select a JAR and class to perform a custom parse routine on this field at runtime. Additionally, you can write a Custom Parse Extension (see above) to perform post-parse operations on the same field.

    The custom class must reside in a JAR that you have developed and imported to the CustomClasses folder in your project.

    Custom Field Serializer

    Click ... to select a JAR and class to perform a custom serialization routine on this field at runtime.

    The custom class must reside in a JAR that you have developed and imported to the CustomClasses folder in your project.

  8. From the main menu bar, select File|Save to save the message definition.

Editing a Message Definition

Adding a Container to a Message Definition

Developing Custom Classes for Transforming Message Definition Fields

Setting Message Definition Preferences

Custom Wire Formats

Supported Character Sets

Supported Datatypes

Supported Datatypes for HL7 Messages

Supported Date and Time Format Codes

Troubleshooting Message Definition Objects

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com