4. pure::variants Connectors

Installing a connector into an existing pure::variants installation works the exact same way like installing the pure::variants Desktop Client into an exsiting Eclipse instance. You just have to make sure the depemding pure::variants connectors are already installed or they have to be installed together with the new connector. See the section called “Using update site”.

To install the pure::variants Connector for Capella, open Capella or Capella Studio and select Help->Install New Software.... Enter the address of your pure::variants update site. From the list of available features, select "pure::variants - Connector for Capella", "pure::variants - Connector for EMF Feature Mapping" and the pure::variants feature (e.g., "pure::variants - Enterprise").

For installation in Capella, the standard Eclipse update site needs to be set up. Otherwise the installation will fail due to missing dependencies. In Capella 1.1.x the Eclipse update site is configured per default. In Capella 1.2.x, the Eclipse Neon update site still needs to be added. To do that, open Window->Preferences->Install/Update->Available Software Sites and add the update site.

For using the pure::variants Integration for Microsoft TFS the server has to be prepared and the pure::variants Integration has to be installed.

The work item types, which should be aware of variability information, must be configured with additional attributes. These attributes can be pvRestriction, pvConstraint, pvDefaultSelected and pvName. At least, the attribute pvRestriction should be created (as shown in Figure 36, “A XML configuration for pvRestriction field.”).


Administrator: For having support while defining restrictions on work items, the control type for the pvRestriction attribute must be configured with "PVRestrictionEditorControl" (see Figure 37, “A XML configuration for pvRestriction field's control type.”).


The pure::variants Connector for PTC Integrity as well as the pure::variants Integrity Integration expect a variant-related preparation of the solution item. For this several changes on the solution and settings are necessary, which are described in the following.

pure::variants uses following settings in order to connect to PTC Integrity. This includes settings for the pure::variants Connector for PTC Integrity, which allows importing and exporting documents, as well as the settings for the In-tool Integration, which allows adding and changing restriction rules in PTC Integrity.


Some of these settings can be directly changed before importing and exporting requirement documents. Others can only be changed in the connector configuration file and in the solution type. The following table shows the property names used to change these settings in the configuration file and the solution type.


To change these settings in the connector configuration file, create the file pvIntegrity.properties in directory %APPDATA%\pure-variants-6. For each setting to change, add a line with the config file property of the setting assigned to the new value. To change for instance the default field used for storing restriction rules to MyRestriction and the default field used for storing the enumerated variants to MyEnumeratedVariants, you would add the following two lines to the configuration file (the comments are optional):

# Field used to store restriction rules
attrname.restrictions=MyRestriction
# Field used to store enumerated variant names
attrname.variants=MyEnumeratedVariants

To change these settings on the solution item, open the Administration of PTC Integrity. Switch to Workflows and Documents -> Types and select the solution type (e.g. MKS Solution).


Right-click the solution type and choose Edit Type from the context menu. Then switch to Properties, click the Create button and enter the solution type property name of the setting you want to change as name. Add the new default value as value and click OK.


Several fields of the original document are copied while creating a document variant. This includes the fields mentioned in section Section 4.4.1, “Add additional Fields for pure::variants” but also some fields that are copied by default. The list of fields that are to be copied by default can be configured by the Integrity administrator.

To additionally copy for instance decompose relationships, the administrator has to open the Administration of PTC Integrity. Then switch to Workflows and Documents -> Types and edit type Requirement. Open the Copy Fields list and add the fields Decomposes To and Decomposed From. This way fields could be added for the types Requirements Document, Requirement, and Shared Requirement.


If you are working with Rhapsody Model Manager (RMM) projects, additional setup steps are needed.

First, you need to make sure that all required software is installed. That includes RMM (Architecture Management) on the Jazz server and Rational Team Concert (RTC) on your client machine. Also in Rhapsody, the Rhapsody Model Manager add-on needs to be installed.

This chapter describes how to installation instructions specific to the codebeamer connector.

When running codebeamer server in a docker container (https://codebeamer.com/cb/wiki/5562876), following additional information needs to be defined in the docker compose configuration file:

volumes:
      -./com.ps.consul.codebeamer.vel.jar:<codebeamer>/tomcat/webapps/ROOT/WEB-INF/lib/com.ps.consul.codebeamer.vel.jar
      -./pvcore.jar:<codebeamer>/tomcat/webapps/ROOT/WEB-INF/lib/pvcore.jar
e.g. 
- ./libs/com.ps.consul.codebeamer.vel.jar:/home/appuser/codebeamer/tomcat/webapps/ROOT/WEB-INF/lib/com.ps.consul.codebeamer.vel.jar
- ./libs/pvcore.jar:/home/appuser/codebeamer/tomcat/webapps/ROOT/WEB-INF/lib/pvcore.jar

To deploy the 'pure::variant Widget to codebeamer' following additional information needs to be added to the docker compose configuration file:

volumes:
      - ./pv_integration/widget:<codebeamer>/tomcat/webapps/pv-widget/

e.g. 
- ./pv_integration/widget:/home/appuser/codebeamer/tomcat/webapps/pv-widget/

Then follow the steps to install:

  1. Shut down the docker container first

  2. Copy 'com.ps.consul.codebeamer.vel.jar' and 'pvcore.jar' found in the zip archive to a location accessible by docker, and as defined in the volumes mapping (see above)

  3. Copy the folder 'pv_integration' including all content to a location accessible by docker, and as defined in the volumes mapping (see above). When updating, please make sure to remove old content of the complete directory first.

  4. Restart the docker container

  5. In codebeamer, add following the "externalWidgetExtensions" section to the Application Configuration (https://<codebeamer>/sysadmin/configConfiguration.spr) as System Administrator:

        ...},
        "externalWidgetExtensions" : {
            "uri" : "https://<codebeamer>/pv-widget/extension.json"
        }
    }

The Web Integration for Codebeamer allows you to pre-define specific settings to ease up or limitate the setup for end-user.

Please see chaper Section 6.2, “Pre-defined settings for Web Integration” for detailed explanations, which settings are available and how they are configured.

To use these pre-defined settings for Codebeamer Web Integration, you need to write the configuration (in JSON format) into a file called settings.json and put this into the deployment directory.

This settings.json must be placed into the existing deployment directory of the Integration.

E.g. <codebeamer>/tomcat/webapps/pv-widget/

|-index.html
|-extension.json
|-settings.json
|-... (other files) 

This file configures the auth-proxy service that is required by the pure::varaints client. The docker container image named “oidc-auth-proxy” will be created and started, on which NGINX service will be available, which in-turn will be used by pure::variants Desktop Client to make the REST calls.

Following parameters are to be set:

Any dependent container(s) that will be used by oidc-auth-proxy or any additional container that needs to be built together can be deployed on the same docker machine by adding in the new container configuration under services.

Following code listing shows an example:

version: '3.1'
services:
  oidc-auth-proxy:
    build:
      context: .
      dockerfile: oidc-auth-proxy.dockerfile
    ##Specify the port to which nginx is listening to. (host port:docker port)
    ports:
      - 9943:9943
    volumes:
      - ./oidc-auth-proxy-nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
      - ./server.crt:/usr/local/openresty/nginx/server.cert:ro
      - ./server.key:/usr/local/openresty/nginx/server.key:ro
      - ./cacerts.crt:/usr/local/openresty/nginx/cacerts.crt:ro
    restart: always

The directives that need to be adapted are as follows:

Following code listing shows an example:

events {
  worker_connections 128;
}

http {
  resolver 127.0.0.11 ipv6=off;
  lua_package_path '~/lua/?.lua;;';
  lua_ssl_trusted_certificate /usr/local/openresty/nginx/cacerts.crt;
  lua_ssl_verify_depth 5;
  lua_shared_dict discovery 5m;
  lua_shared_dict jwks 5m;

  server {
    listen 9943 ssl; ##mention the port to which nginx should listen to
    server_name codebeamer.example.com; ##domain name or ip address of the host on which docker is running 
    ssl_certificate /usr/local/openresty/nginx/server.cert;
    ssl_certificate_key /usr/local/openresty/nginx/server.key;
    ssl_protocols TLSv1.2 TLSv1.3;

    location / {
      access_by_lua_block {
        local opts = {
   ##redirect_uri should match the uri pre-registered in Authorization server during client registration.
          redirect_uri_path = "/login/oauth/authenticate.spr",
  ##OpenID Connect defines a discovery mechanism where OpenID Server publishes its metadata at a well known url of the format: https://server.com/.well-known/openid-configuration
          discovery = "https://jas.example.com:9643/oidc/endpoint/jazzop/.well-known/openid-configuration",
  ##Client_id and client_secret obtained from the authorization server after the client registration.
          client_id = "<set here the client ID>",
          client_secret = "<set here the client secret>",
          scope = "openid profile email",
          access_token_expires_leeway = 30,
          accept_none_alg = false,
          accept_unsupported_alg = false,
          renew_access_token_on_expiry = true,
          access_token_expires_in=3600,
          session_contents = {access_token=true, id_token=true}
        }
        if ngx.req.get_headers()["Authorization"] == nil or (not string.match(ngx.req.get_headers()["Authorization"], "Bearer")) then
          local res, err = require("resty.openidc").authenticate(opts)
          if err then
            ngx.status = 500
            ngx.say(err)
            ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
          end
          ngx.req.set_header("Authorization", "Bearer " .. res.access_token)
          ngx.req.set_header("X-User", res.id_token.email)
        end
      }
   ##proxy_pass value can be a docker container on which codebeamer application is running. For ex., http://container-name:8090; 
   ##or it can be a codebeamer application server url to which a request should be forwarded. For ex., http or https://server-name:port(optional);
      proxy_pass http://codebeamer-app:8090;
    }
  }
}

This chapter describes how to setup the components in order to work properly together with Polarion

There are several steps necessary to prepare the Polarion server for pure::variants.

The connection settings of the pure::variants in tool integration for Polarion can be preconfigured with proper settings in order to ease the process of configuration for the user. Therefore a simple javascript file with the name pv.settings.js is placed in the subfolder webapp of the Polarion server extension. The configuration and possibilities of the javascript file are documented here: Section 6.2, “Pre-defined settings for Web Integration”. The default configuration looks lik this:

              pvWidgetConnectionSettings = {
   // PV_HUB: Defines either 'webhub' or 'desktophub' as tool to connect with
   "PV_HUB": undefined,
   // PV_HUB_EDITABLE: true or false. Defines if the user is able to change the connection
   "PV_HUB_EDITABLE": true,
   // PV_HUB_URL: provide the url if webhub is defined at PV_HUB
   "PV_HUB_URL": undefined,
   // PV_HUB_URL_EDITABLE: true or false. Defines if the webhub url is modifieable
   "PV_HUB_URL_EDITABLE": true
  };

Note

Please make sure not to modify the variable name pvWidgetConnectionSettings during the modification of the settings