4.4.3 Defining Elements (for Non-CSV Format)

You define the contents of a binary format definition file in the Binary Format Definition screen. The Binary Format Definition screen opens when you double-click a binary format definition file displayed in the Package Explorer of Eclipse.

For details about the Binary Format Definition screen, see the manual Cosminexus Service Platform Reference.

Reference note
In the Binary Format Definition screen, you can open multiple binary format definition files and edit them. However, you cannot copy and paste definition information between multiple binary format definition files.

In the Binary Format Definition screen, perform the following tasks to define elements:

The method for defining elements is described below.

Organization of this subsection
(1) Specifying the format information
(2) Specifying globally defined simple content elements
(3) Specifying complex content elements
(4) Specifying components
(5) Specifying a component selection condition
(6) Specifying the root element
(7) Specifying a separator

(1) Specifying the format information

For the format information of the binary format definition file, specify the character code used by the binary data and the endian included in the binary data.

To specify the format information:

  1. In the Binary Format Definition Editor, select and right-click a displayed format name, and choose Setting.
    The Format dialog box opens.
  2. Enter the necessary information in the Format dialog box.
    For details about the display and input contents of the Format dialog box, see the manual Cosminexus Service Platform Reference.
  3. Click OK.
    The information entered in the Format dialog box is set.

(2) Specifying globally defined simple content elements

A simple content element is a simple-type element (xsd:simpleType element) when the format of binary data it uses is expressed as an XML schema, and it can also be expressed as a globally defined element. When a binary format definition file is displayed in the Data Transformation Definition screen, a simple content element is displayed as a node having simple content.

When specifying a simple content element, specify an element data type and size.

To specify a simple content element:

  1. In the Binary Format Definition Editor, select and right-click a displayed format name, and choose Add Simple Content Element.
    The Simple Content Element dialog box opens.
  2. Enter the necessary information in the Simple Content Element dialog box.
    For details about the display and input contents of the Simple Content Element dialog box, see the manual Cosminexus Service Platform Reference.
  3. Click OK.
    A simple content element is set up using the information entered in the Simple Content Element dialog box. The specified simple content element is also displayed in the Binary Format Definition Editor.

(3) Specifying complex content elements

A complex content element is a complex-type element (xsd:complexType element) when the format of binary data it uses is expressed as an XML schema, and it can also be expressed as a globally defined element. When a binary format definition file is displayed in the Data Transformation Definition screen, a complex content element is displayed as a node having complex content.

When specifying a complex content element, specify a component type for the constituent elements of the complex content element. For the component type, specify whether the constituent element is a sequential element (xsd:sequence element) or selection element (xsd:choice element).

To specify a complex content element:

  1. In the Binary Format Definition Editor, select and right-click a displayed format name, and choose Add Complex Content Element.
    The Complex Content Element dialog box opens.
  2. Enter the necessary information in the Complex Content Element dialog box.
    For details about the display and input contents of the Complex Content Element dialog box, see the manual Cosminexus Service Platform Reference.
    When choosing Selection as the component type
    When you choose Selection as the component type, you must set up the selection conditions in components with either of the following methods:
    - Specify Selection condition node, and select the node containing the judgment value of the selection conditions
    - Specify Starting separator of components
    For details about how to specify a selection condition, see 4.4.3(5) Specifying a component selection condition.
    Before specifying a selection condition for a component, you must specify the constituent elements of the complex content element. Carry out step 3 below, and then specify a component by following the procedure described in 4.4.3(4) Specifying components. After that, you can specify a selection condition.
    When a simple content element that is a part of a complex content element is a separator data
    If a simple content element that is a part of a complex content element is the data (separator data) in which each element is separated with separation characters (separator), specify the separators in the complex content element.
    For details about how to specify a separator, see 4.4.3(7) Specifying a separator.
  3. Click OK.
    A complex content element is set up using the information entered in the Complex Content Element dialog box. The specified complex content element is also displayed in the Binary Format Definition Editor.
    Reference note
    The first complex content element that is specified when elements are being defined for a binary format definition file becomes the root element. To change the root element, see 4.4.3(6) Specifying the root element.

(4) Specifying components

A component is an element that constitutes a complex content element. The following two methods are available for specifying a component.

These component specification methods are described below.

(a) Specifying a globally defined element as a component

You can specify, as a component of a complex content element, a globally defined element (simple content element or complex content element) that has already been set up:

To specify a component:

  1. In the Binary Format Definition Editor, select and right-click a displayed complex content element, and choose Add Component.
    The Element Selection dialog box opens. The Element Selection dialog box displays all globally defined elements that can be selected as components of a complex content element.
    For details about the display and input contents of the Element Selection dialog box, see the manual Cosminexus Service Platform Reference.
  2. In the Select Element dialog box, select the element to be specified as a component from the element list.
  3. Click OK.
    Component is added in the complex content element and closes the Select Element dialog box.
  4. Right-click the added component, and choose Setting.
    The Component dialog box opens.
  5. Enter the necessary information in the Component dialog box.
    For details about the display and input contents of the Component dialog box, see the manual Cosminexus Service Platform Reference.
  6. Click OK.
    The globally defined element is set up as a component of the complex content element, using the information entered in the Component dialog box. The specified component is displayed as a lower-order element of a complex content element in the Binary Format Definition Editor.
(b) Specifying a locally defined simple content element as a component

You can specify a locally defined simple content element as a component of a complex content element:

To specify a component:

  1. In the Binary Format Definition Editor, select and right-click a displayed complex content element, and choose Add Local Simple Content Element.
    The Simple Content Element dialog box opens.
  2. Click the Simple Content Element tab and enter the necessary information.
    For details about the display and input contents of the Simple Content Element tab in the Simple Content Element dialog box, see the manual Cosminexus Service Platform Reference.
  3. Click the Component tab and enter the necessary information.
    In the Component tab, specify an occurrence count and size for the component.
    For details about the display and input contents of the Simple Content Element tab in the Simple Content Element dialog box, see the manual Cosminexus Service Platform Reference.
    You can also make the occurrence count and size dependent on another element. In this case, you can select the base node from the Node Selection dialog box, which opens when you click Select Node on the Component tab.
    For details about the display and input contents of the Node Selection dialog box, see the manual Cosminexus Service Platform Reference.
    Clicking OK in the Node Selection dialog box commits the specified value to the Component tab of the Simple Content Element dialog box.
  4. Click OK.
    A locally defined simple content element is set up as a component of the complex content element, using the information entered in the Simple Content Element dialog box. The specified component is displayed as a lower-order element of a complex content element in the Binary Format Definition Editor.

(5) Specifying a component selection condition

If you choose Selection as the component type when specifying a complex content element, you need to specify a selection condition for the component. When a selection condition is set up, the determination of which multiple elements (components) contained in the complex content element are to be used can be made based on the value of another element.

The following two methods are available for specifying a selection condition:

These methods for specifying a selection condition are described below.

(a) Selecting a selection condition node and setting up the selection condition

To select a selection condition node, and then set up the selection condition:

  1. In the Binary Format Definition Editor, select and right-click the complex content element containing the component for which a selection condition is to be set up, and click Setting.
    The Complex Content Element dialog box opens.
  2. In Component Type, choose Selection.
  3. In Selection type, click Selection condition node, and then Select Node.
    The Node Selection dialog box opens. In this dialog box, select a selection condition node.
    For details about the display and input contents of the Node Selection dialog box, see the manual Cosminexus Service Platform Reference.
    Clicking OK in the Node Selection dialog box commits the specified value to Selection condition node in the Complex Content Element dialog box.
  4. In Components, select the element for which a condition is to be specified, and click Set Condition Value.
    The Set Condition Value dialog box opens. In this dialog box, enter a condition value.
    For details about the display and input contents of the Set Condition Value dialog box, see the manual Cosminexus Service Platform Reference.
    Clicking OK in the Set Condition Value dialog box commits the specified value to Selection condition value of the Complex Content Element dialog box. To set up selection conditions for other components, repeat Step 3.
    Any component for which no selection condition is specified becomes a component that occurs when none of the selection conditions specified for other components is satisfied. Only a single such component can be set up.
  5. Click OK.
    The selection condition is set up using the information entered in the Complex Content Element dialog box.
(b) Selecting the starting separator of components and setting up the selection condition

To select the starting separator of components and set up the selection condition:

  1. In the Binary Format Definition Editor, select and right-click the complex content element containing the component for which a selection condition is to be set up, and click Setting.
    The Complex Content Element dialog box opens.
  2. In Component Type, choose Selection.
  3. In Selection Type, select Starting separator of components.
    The component and the starting separator set up in the component will be displayed in Components List.
  4. Click OK.
    The selection condition is set up using the information entered in the Complex Content Element dialog box. Note that when the starting separator is not set up in the component (complex content element), an error will occur during the validation of the binary format definition file.

(6) Specifying the root element

Specify the complex content element that is to be treated as the root element when the binary data used is expressed as an XML schema.

The first complex content element that is specified when elements are being defined for a binary format definition file becomes the root element. To make another complex content element the root element, in the Binary Format Definition Editor, select and right-click a displayed complex content element, and click Set as Root Element.

When Set as Root Element is chosen, the complex content element selected in the Binary Format Definition Editor becomes the root element. In the Binary Format Definition Editor, a root element icon is displayed next to the complex content element that is treated as the root element.

If a complex content element is already specified as the root element, specifying another complex content element as the root element changes the root element. The display in outline view also switches to start with the new root element.

(7) Specifying a separator

If a simple content element, specified as part of a complex content element, is the data (separator data) in which each element is separated using a separation character (separator), specify the separators in the complex content element.

The details about how to specify a separator is explained below:

  1. Select the complex content element, right click, and then click Setting.
    The Complex Content Element dialog box opens.
  2. Choose the Separator tab.
    The contents of the Separator tab in the complex content element dialog box are displayed.
  3. Select the separator format to be used from the drop down list.
    Note that when you select CSV as a separator format, the starting separator and the intermediate separator will be set up automatically.
  4. Select the Separator to be used check box and click Select.
    The Select Separator dialog box opens. For details about the display and input contents of the Select Separator dialog box, see the manual Cosminexus Service Platform Reference.
  5. Choose a separator that you want to use from the list and click OK.
    The information about the separator selected in the Separator tab of the complex content element dialog box is displayed.
    Note that if the separator you want to use is not present in the Select Separator dialog box; click Add in the Select Separator dialog box. The Add/Change Separator dialog box opens. You can add or change separators in this dialog box.
    For details about the display and input contents of the Add/Change Separator dialog box, see the manual Cosminexus Service Platform Reference.
  6. Repeat step 3. and 4. as needed.
  7. Click OK.
    The separator is specified in the information entered in the Separator tab of the Complex Content Element dialog box.