Fetches data from XML database and loads into the related control.
Query
Query
Write your XQuery script here. See XPath and XQuery for more details.
Scratch Query
You can use this query area for testing purposes.
Results Section
This section lets you test your query with the actual data from XML repository.
Results
There is a list named Parameter Values under this tab. The parameters added in the Parameters tab are also listed here with their Value box empty. Enter values for the listed parameters to trigger and test your query.
Table View
This table view section displays the test query result in a table view, just like it is displayed on the form.
Parameters
Options of which database to query and parameter assignments.
Repository
Select the location of data to query, either Domain or Process repository.
Parameters
Create parameters with name and value xpath pairs to use data from form XML in the query.
- Name : Parameter name to be used in the XQuery.
- Value XPath: XPath for parameter data to be gathered and used in the query.
Formatting
Options to format the result data.
List Item Formatting
Customizes format of query result.
Display Text Format
Specify the format to display result text. You can use XPath inside curly braces. Ex: {{name}} - {{id}}
Value Format
Specify the format of value. You can use XPath inside curly braces. Ex: {{id}} - {{type}}
Table View Columns
Columns added in this section will be displayed in the result pane of the query.
Caption
Title of a column.
Value
Value of a column.
Item XPath
Specifies item that will be listed in the control. If it is left empty, which is same with * value, all resulting items are being listed.
Hierarchy XPath
Mappings
Options to map the result data.
Selection Mappings
In order to map the selected data from XQuery result into a node of the form, create a mapping by pressing Add New button.
Source
Node name to map its data.
Target
XPath to map data into.
Examples
The query below basically gathers data from forms, instances and workitems associatively and returns them in a desired format.
This example demonstrates the general FLWOR structure in XQuery, so we can read the query as the following:
- For expression loops over Instance nodes that are located on root level and assigns them to parameter $i
- Let expression gathers several information depending on instance, workitem and form data
- Where expression applies criteria on the data. Control parameters used in this section are declared in Parameters section on the same window.
- Order expression orders the result according to the given value
- Result expression returns the result data in the specified XML format
The example above demonstrates how you can rename a node before returning it. This usage does not affect the original node name, only the returning node name is changed.
There are many more examples, including this rename operation, in XQuery section.