Defining stream output rules  Adding field separators

Chapter 3: Building Production Objects

Defining rule components (subrules)

Rule components (subrules) determine which pieces of data (which input objects) to manipulate and place into a rule object’s output message area. Each rule component generates a piece of the output transaction by manipulating the data in an input field object with a filter object, or by defining a literal value to place into the output transaction.

A rule component object can also manipulate a rule object’s blob, affecting the output transaction up to and including its own contribution to the blob.

StepsDefining rule components

  1. When an existing project is loaded, select View | Rules Component Objects or click the SubRules icon to display a list of all rule component objects defined in the current file.

  2. To build a new rule component object, click New below the Rule Component Objects list in the TRAN-IDE window.

    NoteTo change an existing rule component object, double-click its name in the list.

    The Rule Component Information window appears.

  3. Complete these options:

    Field (key)

    Description

    Name

    A rule component’s name. If you select an existing rule, its name displays in this field. If you are building a new rule component, enter the name here. Append “_rc” or “_part” to all rule component names.

    Field

    Have the current rule component consist of or act on a field that is already defined. Enter the field object’s name in the space provided, or choose the name from the list that displays.

    Note If the specified field object is defined as optional and is not present in the incoming transaction, the rule component’s filters are still run. If you do not want these filters run when the optional field object is not present, use a qualification object to check for the presence of the field object before entering the rule component object.

    Literal

    Add a literal value to the output transaction, then enter the literal’s value, up to 255 bytes, in the space provided. This value will be modified by any pre-and post-filters defined in this rule component. The literal’s value can contain embedded escape sequences (for example, “\015”). When including a null byte in the literal value, use “\NUL” instead of “\000”.

    Group

    Have the current rule component consist of or act on a nested group. In the first entry field, enter the name of the field object that defines the nested group, or click the down-arrow to choose the name from the list of field objects.

    In the second entry field, enter the name of the rule object that should process the nested group, or click the down-arrow to choose the from a list of rule objects.

    WARNING! Rule objects that use the Group option should not be attached to a specific production object. Define the rule object from the main TRAN-IDE window (this procedure) instead of creating the rule from the Product Object Information window.

    Datalink

    Have the current rule component consist of or act on a datalink. Enter the datalink’s name or choose it from the drop-down list. Click the ellipsis button to view information about the selected datalink or to create a new datalink on the fly.

    NoteWhen the datalink is a character array, the rule component object acts on the entire array as if it were a string; it cannot access the individual elements of the array. Access the array elements using ODL code in custom filter functions. See “Writing custom filter functions”.

    None

    If you do not want the current rule component to use a field object, a literal, a group, or a datalink, select this option. Use this option when you want the filter to generate the data or a filter function is used to perform some action that does not require the addition of new data.

    Default Value

    Optional. The literal value to place into the output transaction if one of the component's filters fails or if the component’s data source is empty. When one of the component's pre- or post-filters fails or its data source is empty, the SFM removes all output generated by that Component from the outgoing transaction, places this literal value into the outgoing transaction instead, and continues to process the transaction with the next component.

    If you do not have a value in this entry field, but do have a value in the Default Value field for the rule, and one of the component’s filters fails or the component’s data source is empty, the SFM removes all output generated by the component’s rule object from the outgoing transaction, places the default value for the rule into the outgoing transaction instead, and continues to process the transaction with the next rule object. If you do not have a value in either the component’s or rule’s Default Value field, the SFM stops processing the transaction.

    The literal value uses these format specifiers: “%s” for spaces, “%d” for zeros, and “%b” for binary zeros. Place an integer number after the % to indicate the number of spaces or zeros to use. The literal value can also contain other characters that are copied into the blob exactly as entered. When including a null byte in the literal value, use “\NUL” instead of “\000”.

    Example – “%5dempty%5d” results in “00000empty00000”.

    Length D/L

    (Optional.) The name of the datalink to hold the size of the data generated by the rule component object. e-Biz Impact calculates the size of the component’s output blob after executing the component’s post-filters, then places the size into this datalink object. Because the datalink is set to the size of the component’s output blob, if the rule component has a qualification object associated with it, the datalink object is set to the size of the output blob if the rule component qualified. If the rule component does not qualify, the datalink object is set to zero since no output was generated.

    Value D/L

    (Optional.) The name of the datalink object to hold a copy of the data generated by the rule component object. e-Biz Impact puts a copy of the component’s output into this datalink object after executing the component’s post-filters.

    Pre-Filters

    A list of the pre-filter functions. The filters work on the data source you specify. The SFM runs the filters in sequence, from the top to bottom. See “Defining filter objects”.

    Post-Filters

    Post filters perform additional processing on the outgoing transaction as it has been built up to that point. The SFM performs each post-filter in sequence. See “Defining filter objects”.

    No Default Separator

    Select to not automatically append the default rule component separator to this rule component object’s output. This option is useful only when the rule component separator is selected in the production object Options window.





Copyright © 2005. Sybase Inc. All rights reserved. Adding field separators

View this book as PDF