Mapping Data From the dbeventstream.xsd File to an Output Schema

After you set up RepConnector to receive inbound database events, you can develop a transformation service to map the inbound data from dbeventstream.xsd (the database event schema) to an output schema, depending on your application.

You must map each cell element to a target in the output database schema, making sure each cell name attribute is set to the appropriate database column name, for example, po_number.

  1. Create a service with a Transformation endpoint binding.
  2. Open Services Preferences and select the Allow schema without target namespace check box.
  3. When selecting the source schema, select dbeventstream.xsd as the source schema in the left pane of the Select Schemas dialog.
  4. In the Select Schemas dialog, when you select the source element, select the dbStream element, which is the root element and contains all other elements and attributes.
  5. In the Select Schemas dialog, when selecting the target schema, select the output schema you are mapping the inbound database event to.
  6. Map the relevant dbeventstream.xsd name elements to the output schema.

    That is, inspect the value of each cell element's name attribute. If a name attribute contains one of the input parameters from the source database, map its cell element to the appropriate target in the output schema.

    Note: If you need to map multiple source elements to a single target element, see Linking a Source to a Target.
  7. After you map a cell element to a target, select the connector arrow.

    The Transformation Rule section displays the cell element and the target element on the Transformation Rule canvas.

  8. In the Transformation Rule canvas, double-click the cell elements' icon.

    The XPath Work area dialog opens.

  9. In the XPath Workarea dialog, enter an XPath predicate.

    For example: /dbStream/dbEvent/insert/values/cell[./<namespace prefix>:name='po_number']

    The XPath string must have all of the following components for each cell element you map.

    Table 1. XPath mapping components
    Component syntax Description
    /dbStream/dbEvent/ Specifies the root element for all dbEvent commands, for example, update, insert, and so on. Do not customize.
    /insert/values Specifies the input parameters you are mapping in the values element from an insert event. Do not customize.
    cell Specifies each dbEvent command element contained in the cell element. Do not customize.
    ./<namespace prefix>:name Specify each cell element as a ./<namespace prefix>:name attribute that is used as an input parameter from the source database, where the <namespace prefix> is supplied by Sybase WorkSpace.

    Determine which cells are used for input parameters, that is the input parameters that are designated when the RepConnector subscription was created.

    po_number Specify the po_number string as the value of the ./ns:name attribute by replacing the po_number with the actual column name of the source database.

    The result is the source database column is mapped to the appropriate element in the output document.

  10. Repeat the above steps until each input parameter cell element is mapped to the target schema.
Next (Optional) Add the transformation service to a business process service.

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.