Creating Dynamic XML-Queries

Overview

In order to dynamically create XML queries at runtime, you need an XSLT Converter, which you connect with the Database Connector:

module guide 975 0

The XSLT Converter converts the XML based input message by using an XSLT stylesheet into an XML query and hands this XML query over to the Database Connector for execution.

Prerequisites

The following data is required.

  • Metadata of your database, at least table and column names are known.

  • Sample XML input message.

Proceed as follows

  1. Create a Technical Workflow containing a Database Medium or Output Connector.

  2. In the Database Connector activate the option Execute input message as query in the Function area.

  3. Publish the Database Connector.

  4. Add an XSLT Converter to your Technical Workflow.

  5. Connect both modules.

  6. Open the XSLT Converter for editing and display the XSLT Mapper.

  7. In the XML source file area open the menu module guide 975 1, select Open and load your sample input message.

  8. Create the XML query

    1. In the XML target file area, open the Database Explorer:

      module guide 975 2
    2. Let the database explorer guide you through the creation of the XML query.

      After finishing the Database Explorer, the XML query is displayed in the XML target file.

    3. Drag and drop the queries element on the xsl:template element.

    4. Map the elements contained in the sample input message on the query elements.

      In order to be able to map ResultSet entries to queries, add the attribute queryID to the query. In the ResultSet, this attribute is filled with the value of the corresponding query regardless of whether the query was executed successfully or not.

  9. Publish the Technical Workflow.