The Polarion adapter allows to extract table items from a Polarion database server and to open Polarion artifacts from ANALYZE.
Instead of connecting to the Polarion application server, ANALYZE connects directly to the Polarion database. To make this possible, you have to allow external access to the database. Polarion provides a description of how to do so: https://almdemo.polarion.com/polarion/sdk/doc/database/ExternalDatabaseConnection.pdf. You can use any SQL client to check whether you can successfully connect to the database.
When you first start YT with the adapter enabled, a dialog will ask you for a user name and password for the login. You can store this information in Eclipse’s Secure Store such that you don’t need to re-enter it later.
You can also provide the login credentials as java system properties
POLARION_LOGIN_USERNAME
and
POLARION_LOGIN_PASSWORD
. You can set these properties either directly via the the command line or in a configuration file that you specify with YT’s
--properties
command line option (see
Executing itemis ANALYZE in batch mode ). Alternatively, you can define environment variables with the same names.
Double-clicking on a Polarion artifact in ANALYZE will display this artifact in a web browser. This also works the other way round: If you select another artifact in the browser, ANALYZE will select it as well.
In order to make this work, you have to configure a so-called web driver in ANALYZE. ANALYZE will need it to do two things:
Please note that the web driver must match your web browser and your operating system. You can find the web driver executables for several web browsers in the following table. Follow the instructions (if available) on the particular website and make sure to download the web driver that matches your web browser and its version as well as your operating system.
Browser | Website |
---|---|
Firefox | https://github.com/mozilla/geckodriver/releases |
Chrome | http://chromedriver.chromium.org/downloads |
Edge | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ |
Unpack the downloaded archive file to an arbitrary directory on your computer.
Configure the web browser and the associated web driver in the ANALYZE preferences:
A correct configuration might look like this:
If you do not configure a web browser and a web driver as described, ANALYZE will use the internal Eclipse browser. However, that browser is rather limited. While it supports selection propagation from ANALYZE to the browser, it does not support the opposite direction. That is, you can select an item in ANALYZE and have it displayed in the browser, but if you select anything in the web browser, ANALYZE will not get notified.
You will also have to set a webURLPrefix in the Polarion data access configuration.
The Polarion data access configuration specifies the Polarion database server to connect to.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new data access as described in section "Data accesses". Select Polarion as data access type.
Supported keywords:
http://mypolarion.example.com
. The URL prefix must point to the web server that is integrated into the Polarion server.
Sample configuration:
server "192.168.3.160:5433" user "external" password "secret007"
undefined attribute value = "<undefined>"
The example above will connect to the Polarion database server, which must be available at the IP address 192.168.3.160 and must be listening on port 5433. The user name for logging in is „external” with the password „secret007”. Whenever a nonexistent parameter is accessed, the text value
<undefined>
will be returned.
server "192.168.3.160:5433" user "external" password "secret007" webURLPrefix "http://mypolarion.example.com"
In addition to connecting to the database server, the above configuration also specifies a URL prefix (webURLPrefix). ANALYZE uses it for opening a Polarion artifact in a web browser. Double-clicking on a Polarion artifact in ANALYZE navigates the web browser to the URL that results from concatenating the URL prefix and the indication of the specific work item.
To enable the connection between your Polarion database and ANALYZE you can follow the description provided by Polarion which explains how to connect a database with an external source.
The Polarion adapter allows for flexible artifact configuration to specify which artifacts ANALYZE should import from the Polarion data access.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new artifact type as described in section "Artifact types". Select your previously-configured Polarion data access in the Data access drop-down list.
Supported keywords:
To filter artifacts delivered by the data access the include objects if( condition ) expression is used. It instructs the Polarion adapter to only consider artifacts that satisfy the specified condition.
A condition is defined by the following syntax:
valueOf( attributeName ) operator value
Here,
When mapping more than two attributes to the values of a Polarion work item you have to use a Circumflex (freestanding) ^ as the escape character.
As attributeName, you can use any of the predefined constants from the following list:
To access custom fields, use customField instead of valueOf.
A custom field is a named field you can define in Polarion, in addition to the work item fields mentioned above. A work item can have zero, one, or more custom fields.
Polarion provides a number of possible types for custom fields, including multi-value types. However, when accessing custom fields from ANALYZE, values are always mapped to text strings in ANALYZE, i.e., an expression like
customField("storyPoints")
always returns a text. If a custom field has multiple values, ANALYZE retrieves them as a single string with the individual value separated by a comma (‚,’).
To access the value of a custom field, use the customField clause. You can use the customField clause multiple times to access multiple custom fields. While editing, code completion will show you the available custom field name.
Please note: Multiple conditions are implicitly concatenated by a logical AND.
Example:
include objects if(
valueOf(type) == "userstory"
customField("storyPoints") != ""
)
name valueOf(id)
The example above will include artifacts whose
type is
userstory
and that have the custom field
storyPoints set. The custom field
storyPoints being unset will be recognized by comparison with the empty string. The latter could be changed by the
undefined attribute value option in the
data access configuration. The
name of these artifacts will be set to the
id attribute’s value.
If you want to include artifacts whose
author contains e.g. the name
Max
you can use the
contains keyword:
include objects if(
valueOf(type) == "userstory"
valueOf(author) contains "Max"
customField("storyPoints") != ""
)
name valueOf(id)
You can map attributes, too. Example:
include objects if(
valueOf(type)=="userstory"
valueOf(author) contains "Max"
customField("storyPoints")!=""
)
map{
^attribute to valueOf(author)
^severity to valueOf(severity)
}
name valueOf(id)
This example expands the previous example. Here we are mapping two attributes to the values of a Polarion work item.
The Polarion adapter allows to specify which links ANALYZE should import from the Polarion data access. Make sure artifact types have been configured before.
Open the ANALYZE configuration with the ANALYZE configuration editor, and add a new link type as described in section "Configuring a link type".
By the way, if you want to create links between Polarion and data from another tool, please refer to this section.
By default all links in Polarion are resolved against the current (latest) items and ignored if the item does not exist. If you want to read only links which are not linked to the baselined version of an item you can configure the mapping to ignore them:
link source is A
include link if (
valueOf(revision) == ""
)
Example:
Supported options:
A list of available link attributes can be displayed by content assist (pressing [Ctrl]+[Space]
inside the braces of
valueOf).
Example:
In this example, ANALYZE reads all trace links between two polarion items which are not suspect. The attributes suspect, role, and revision are available in link attributes.