After you set up RepConnector to receive inbound database events, you can set up 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's name attribute is set to the appropriate database column name, for example, po_number.
The new transformation service can then be added to a business process service.
Create a transformation service.
Open Service Preferences by choosing Window|Preferences and select the Allow schema without target namespace check box.
When selecting the source schema, select dbeventstream.xsd as the source schema in the left pane of the Select Schemas dialog.
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.
In the Select Schemas dialog, when selecting the target schema, select the output schema you are mapping the inbound database event to.
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.
If you need to map multiple source elements to a single target element, see Linking a Source to a Target for complete information.
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.
In the Transformation Rule canvas, double-click the cell elements' icon.
The XPath Workarea dialog is displayed.
In the XPath Workarea dialog, enter an XPath predicate similar to the following:
/dbStream/dbEvent/insert/values/cell[./@name='po_number']
The XPath string must have the following components for each cell element you are mapping:
Components of the XPath mapping string
Component | Explanation |
---|---|
/dbStream/dbEvent/
| Do not customize. Indicates the root element for all dbEvent commands, for example, update, insert, and so on. |
insert/values/
| Do not customize. Indicates you are mapping an input parameter from an insert event. All input parameters are contained in the values element. |
cell
| Do not customize. Each dbEvent command element contains a cell element. |
name
| Each cell element has a name attribute, each of which is used for an input parameter from the source database. You must determine which cells are used for input parameters, which were designated when the RepConnector subscription was created. |
po_number
| The po_number string is the value of the name attribute. Replace po_number with the actual column name of the source database. The end result of mapping the cell element and entering the column name is that the source database column is mapped to the appropriate element in the output document. |
Repeat the above steps until each input parameter's cell element is mapped to the target schema.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com