Extracting data using native filters

If you are using Rational Publishing Engine 1.1.1 or later, you can use native filters with IBM® Rational® DOORS®, IBM Rational Tau, and REST. Native filters, which are interpreted by the data source, allow you to enter filters in the data source format. The native filter is processed by a data source; no processing or validation is done by IBM Rational Publishing Engine.

Before you begin

Test the filter condition in the native data source to verify that it is correct. Then test the filter condition in the native data source.

About this task

It is important that the native filters are supported by the REST data source, otherwise the entire data is fetched from the report and will not be filtered. It is important that the data source supports filtering, sorting and selective support of properties. Native filters gives you the ability to request from the data source. The resultant data is filtered and refined. You do not have to do anything on the client.

With the previous releases of IBM Rational Publishing Engine, you could define filters that were static, you had to know them when you designed the template and you could not change them at runtime.

Note: Native filters apply to any data source but the syntax is specific to each data source. Refer the documentation of the provider or information on syntax.

Procedure

  1. In Document Studio, select the template element that contains the query that is to be filtered.
  2. In the Properties tab, expand Property > Data and Filter.
  3. Click the button in the Filter field under the Value column.
  4. In the Native Filter tab, expand Variables, select the desired variable and use the syntax ${} to define your query to be filtered. For example, cq:Product{cq:Product"${productName}". Click OK. This simple filter makes the template very generic, as you can specify your query, for example, Product Name. Another product team can also use this template and specify their product name, in the document specification at runtime.
    Note: To extract Rational DOORS data, use the DXL script as native filter condition. To extract REST data, use the XPath filter condition.

Example

Rational Clearquest

A sample variable: filter: cq:Product{cq:Product="${productName}")

productName: Rational Publishing Engine

A resolved filter: cq:Product{cq:Product="Rational Publishing Engine")

Rational DOORS

The following Rational DOORS native filter example filters object that contains the word "shall" in the Object Text attribute.
Extracting DOORS data using native filter

IBM Rational Tau

The following IBM Rational Tau native filter example filters packages that contains predefined names.

Schema element, model.predefinedPackage represents the current schema element.

Underlying Tau query, GetEntities(“predefinedPackage”).select(IsKindOf(“Package”) represents the query.

Native filter, select(HasPropertyWithValue("Name", "Predefined")) represents the native filter condition.

The query executed by Tau query evaluator is:

GetEntities(“predefinedPackage”). select(IsKindOf(“Package”))
select(HasPropertyWithValue("Name", "Predefined"))

Rational Requisite Pro

The following REST native filter example extracts the Requisite Pro PRRequirements using Stability='High'. In this case, a filter expression has been added to the node below Appliances, selecting only the appliances manufactured by a specific manufacturer.

fields=Project/Requirements/PRRequirement[Stability = 'High']/(Stability|FullTag|Priority|Status)

Example 2

Lets look at the following IBM Rational DOORS example of using Native filters in templates and how to create such a filter.

To define a native filter for a IBM Rational DOORS data source, use the DOORS Filtering window.
  1. Open a IBM Rational DOORS Module, and from the main menu, select, Tools > FilterDefine menu entry.

    If for example, you want to filter only those objects that contain the word abc in the Object Text attribute.

  2. Create the filter, click Description and copy the filter full description.
You now have the DOORS Filter which is a DXL script. You have to paste it in the Filter Editor from Rational Publishing Engine using the following steps:
  1. Select the template element that contains the query that is to be filtered.
  2. In the Properties view, expand Data, scroll down to the filter property's value column and click ellipses. The Filter Editor window is displayed.
  3. In the Native Filter tab, paste the DOORS filter (DXL script) and click OK.

Feedback