Customize or Edit a B2B Schema

To create custom schemas, you can add new constructs (such as new segments and elements) to a standard B2B schema or edit existing constructs within it.

About B2B Schema Constructs

A B2B schema represents the message format of an EDI X12 or EDIFACT document, which is a hierarchical structure based on four types of constructs:

  • Element: The smallest unit that represents a single data field of a primitive type, such as, alphanumeric text, integer, decimal, date, time, or binary.
  • Composite: A complex data type consisting of one or more elements.
  • Segment: The next higher level construct, consisting of a sequence of elements and composites.
  • Loop or Loop Segment: A container for a specific set of segments or child loops, which make its structure nested and hierarchical.
The schema editor in B2B for Oracle Integration displays each of these constructs in its own row. The rows for segments, composites, and loops are expandable, and display the elements they contain. The order of the rows in the schema defines the exact order in which each of the constructs must appear in an actual EDI X12 or EDIFACT document.
  • An EDI X12 document, which is the topmost construct, is defined as an ordered set of segments and loops. The schema for all EDI X12 documents starts with a segment named ST and ends with the segment SE across all documents types. These segments are called transaction set envelope segments, and they cannot be deleted in the B2B schema editor.
  • An EDIFACT document, which is the topmost construct, is also defined as an ordered set of segments and loops. The schema for all EDIFACT documents starts with a segment named UNH and ends with the segment UNT across all documents types. These segments are called transaction set envelope segments, and they cannot be deleted in the B2B schema editor.

Add New Segments and Other Schema Constructs

According to your organization's requirements, you can add new constructs to a standard B2B schema to customize it.

To add new constructs to a schema:
  1. On the B2B Schemas page, hover over a schema and click Edit Edit icon.
  2. In the schema editor, hover over a row of required hierarchy and click Actions Actions.
  3. Select an option from the Actions list to add a new construct. The Details panel appears on the right, displaying the Properties tab, where you can enter the necessary information.

    Note:

    The options displayed in the Actions list vary according to the hierarchy of the rows. The Actions list for a segment or loop row has options to create new child elements, child composites, segments and loops, whereas the Actions list for a composite or element row has options to create only new composites and elements.

Edit Properties of Segments and Other Schema Constructs

B2B for Oracle Integration allows you to modify properties of existing constructs of a schema that's derived from a standard schema.

To edit the properties of constructs:
  1. On the B2B Schemas page, hover over a schema and click Edit Edit icon.
  2. In the schema editor, hover over a row you want to modify and click Edit DetailsEdit Details.

    The Details panel appears on the right, displaying the Properties tab. The property fields displayed in the tab vary for element, composite, segment, and loop rows. You can edit the field values to customize and deviate from the X12 standard according to your business requirements. The following sections describe the different property fields that are displayed for each construct type.

Element Properties

Property Description
Name

A descriptive name for the element.

Element ID

The ID that identifies this element in the EDI X12 or EDIFACT element dictionary. This field is not editable.

Position

The element's position number within the parent segment or composite. This field is not editable.

Purpose

A detailed description of the element's purpose.

Requirement
  • Mandatory: The element must have a nonempty value in an EDI document.
  • Optional: The element may have a value or be empty.
  • Conditional: The element may have a value or not depending on syntax rules defined on the parent segment or composite.

This setting is preselected by the X12 or EDIFACT standard and typically not modified. To override this setting, modify the Usage field.

Usage

This field overrides the Requirement field. When this field is left blank (no value selected), it implies that the element is used and the selection made in the Requirement field is enforced.

  • Must Use: Overrides the selection in the Requirement field and treats the element as mandatory.
  • Not Used: Overrides the selection in the Requirement field and specifies that the element should remain empty (that is, not have a value).
  • Recommended: Follows the selection in the Requirement field, but suggests that the element is a preferred element.
  • Not Recommended: Follows the selection in the Requirement field, but suggests that the element is not a preferred element.
Type

The element's type as defined by the X12 standard in the EDI X12 element dictionary or the EDIFACT standard in the EDIFACT element dictionary.

The type is one of the following: ID (Identifier), AN (Alphanumeric Text String), DT (date), TM (time), N(0-9) (Integer with implied decimal), R (Decimal), or B (Binary). This field is not editable.

Length (Min / Max)

The minimum and maximum characters (or numeric digits) that the element's value allows.

Repeat

Specifies if it's a repeating element.

  • 1: Indicates that the element has a single value (non-repeating).
  • A number greater than one or the >1 symbol: Indicates that this is a repeating element; that is, one element accommodates multiple values.

The EDI X12 version 4012 and older versions do not support repeating elements; therefore, this setting is ignored for those versions.

Composite Properties

A composite has property settings similar to an element construct, except for the Type and Length fields.

Segment Properties

A segment has several property settings similar to an element construct. However, it doesn't have the Element ID, Type, and Length fields. In addition, there are the following differences.

Property Description
Repeat

For a segment, this property indicates how many consecutive instances of the segment may occur in an EDI document. Segment repetition is supported in all X12 versions, unlike elements.

Table Area

Indicates the section of the EDI document to which this segment belongs. Typically, an EDI document is defined with a heading, summary, and detail sections, also called table areas.

Loop Properties

A loop has four property settings, namely Requirement, Usage, Repeat, and Table Area, which have similar meanings as those of a segment.

Edit the Code List for an Element

In addition to properties, you can also edit code lists for element constructs while customizing standard B2B schemas.

Some EDI X12 elements are restricted to a set of enumerated values. A code list displays the allowed values for an element. Typically, elements of the type ID (identifier) have a code list associated with them; however, any element can have a code list.

To edit an element's code list,
  1. Hover over the element row and click Edit DetailsEdit Details.

    The Details panel appears on the right, displaying the Properties tab.

  2. Click Code List Code List.

    If there is a code list defined, all code values are displayed in the table.

  3. Hover over a row and use the buttons that appear to edit or delete the row or to add a new row.
    While editing, you can add a description and a note to each code. While deleting, a row is first marked for deletion (which can be reversed with an Undo) and is actually deleted upon clicking Save.

    Note:

    While adding a new row, you can insert it at any position. The validation of an element's data against the code list happens regardless of the order. After a Save action, the code list is sorted alphabetically.
  4. If you want to edit several rows in a code list, use the Export CSV action under Code List Actions to export the list to a comma-separated values file for editing in an external tool, such as a spreadsheet editor.

    The CSV file has a header row identical to the code list table. After the editing is complete, you can import it back using the Import CSV action. This overwrites the existing code list completely with the codes defined in the CSV file.

Multiple Code Lists for an Element

Occasionally, you may find elements with multiple code lists. One such example is the element TD101 (Packaging Code) for the document type EDI X12 850 (any version). This element has two code lists defined as follows:

Description of multiple_code_lists.png follows
Description of the illustration multiple_code_lists.png

The element's data value is a concatenation of one code from each of the code lists. For example, a value of AMM01 is a valid data value because it uses AMM from Code List 1 and 01 from Code List 2.

Customizing a Code List

An element is considered customized (with respect to code lists) if any of its associated code lists have codes that are different from the standard X12 codes. However, only changing the description or adding notes is not considered a customization because it does not affect the element's allowed data values or the validation.

Edit Syntax Rules for Segments and Composites

You can view and edit the syntax rules, if defined for a segment or a composite. These rules apply to data elements and are enforced during the validation of the input data.

Note:

You cannot edit a schema currently in use in an active document definition.
  1. From the navigation pane on the Oracle home page, select B2B > B2B Schemas.
    The B2B schemas page shows all custom schemas you have created by cloning the standard schemas.
  2. Open a custom schema, find the segment you want to view (for example, CUR), and select Edit DetailsEdit Details.
  3. Click Syntax Rules icon in the Details pane to display the syntax rules enforced for the selected segment.

  4. Hover over a syntax rule row to see options to edit, add, or delete a rule.
  5. If you select the Add icon, a Select list is displayed with the following syntax rule types:
    X12 Syntax Rule Description
    Pairing If any of the elements are present, all are required.
    Conditional If one element is present, other elements are required.
    List Conditional If one element is present, at least one of the other elements is required.
    Required At least one of the elements is required.
    Exclusion Only one of the elements may be present.

    For each rule, you are presented with either one or two element selections into which you select elements.

  6. For example, if you add the List Conditional rule, click select an element for the first element selection and click select one or more elements for the second element selection.
    List Condition rule with links for select an element and for select two or more elements.

  7. Select appropriate elements.
    The current selections are displayed in terms of the element position numbers.
    List conditional with Elements 3 and 4 selected.

    The element position numbers identify the corresponding child elements inside the selected segment or composite. For example, 2 means CUR02 below and 3 and 4 mean CUR03 and CUR04.



  8. Click the element numbers in the rule description to add or remove elements.

    Note:

    Deleting a syntax rule first marks it for deletion (which can be undone) and then deletes it when the B2B schema is saved.