6.13. Importing and Exporting Models

Models may be exported from pure::variants in a variety of formats. An Export item is provided in the Navigator and Variants Project views context menus and in the File menu. Select Variant Resources from category Variant Management and choose one of the provided export formats.

Currently supported export data formats are HTML, XML, CSV and Directed Graph. The Directed Graph format is only supported for some models. Additional formats may be available if other plug-ins have been installed.

HTML export format is a hierarchical representation of the model. XML export format is an XML file containing the corresponding model unchanged.

CSV, character separated values, export format results in a text file that can be opened with most spreadsheet programs (e.g. Microsoft Excel or OpenOffice). CSV export respects the filters set in the editor of the model to export, i.e. only the matching elements are exported. The export wizard permits the columns to be generated in the output file to be selected.

The HTML Export generates representations for feature and family models in HTML. The generated HTML file can be opened by any browser (e.g. "Internet Explorer", "Firefox", etc.).

The export will generate a navigation section which represents all model elements hierarchical in a tree and the data of the elements on the right side of the generated html page. The navigation tree will help to navigate to elements quickly. The selected element in the navigation section will be shown on top of the content section. Each section of an element includes the following paragraphs:

The General Properties paragraph shows information like Unique Name , Element Class , Variation Type , Element Type and Default Selected .

The following two pictures are showing the HTML Export wizard. The first page enables the user to define an absolute path for the output file. Using pure:variants path variables is supported. The style of the html output can be adjusted individually by referencing your own stylesheet (*.css) either as web URL or local file. The stylesheet can either be linked or inlined in the html output file.


On the second configuration page a filter can be selected, which applies to the selected model. Elements which apply to the filter are not included in html output. Please see Section 6.9, “ Filtering Models ” for further instructions. To hide specific information (e.g. "Restrictions", "Specific Attributes",...) in the selected model a tree layout can be selected in the combo box Layouts . For further Information see the section called “ Tree Editing Page ” .


The following stylesheet classes are supported in the HTML Export.

Table 6.3. Table of CSS classes
CSS Class Description
.section All sections including "General Properties", "Description", "Properties" and ...
.ps-general "General Properties" section placed beneath Feature headline
.ps-description "Description" section placed beneath "General Properties"
.ps-properties "Properties" section placed beneath "Description"
.ps-relations "Relations, Restrictions, Constraints" placed beneath "Properties"
.ps-breadcrumb Breadcrumb navigation path beneath Feature's headline
.ps-feature Section of a Feature

Is the html output opened in a browser the following interactions are available:

  • Breadcrumb navigation placed beneath each element headline to navigate quickly to the parents of the element.
  • Expand/Collapse tree buttons on the bottom of the navigation on the left side of the website to expand/collapse the navigation tree.
  • Expand/Collapse model buttons on the right bottom of the website to expand/collapse all element sections.
  • Expand/Collapse buttons on any element sections and headline to expand/collapse all element sections and headline of the same type in the whole html document.
  • Elements having a relation have a hyperlink to quickly navigate to the related elements.

The following image shows a typical html export.


It is not possible to export a Variant Description Model using the export wizard as described above. For exporting a vdm a transformation module is used. The transformation is described in the next section.

For exporting a vdm to a html document the transformation module HTML Transformation Module is used. See below the module in the transformation module selection dialog.


The next image shows the parameter of this transformation module.

The parameter Output enables the user to define a different output folder, for the result of the HTML transformation.

The transformation module for HTML has three different modi, called Result Models Tailored , Result Models Annotated and Input Models Only . The modus is selected with the parameter Mode

The Result Models Tailored mode executes a transformation of on variant description model and will output the transformed feature and family models as html representation. Each model will generate a single html output file. The name of this file will be the name of the model suffixed with the model type. In this mode only elements part of the variant will get exported to the html.

The Result Models Annotated mode exports all elements defined in the input models, but it will gray out all the elements, which are not part of the transformed variant..

The Input Models Only mode doesn't execute a transformation but exports all input models defined in the used configuration space. Furthermore are all configuration parameters definable except the filter parameter.

Third parameter Layout is optional. If used it defines a tree layout, which will be used during the transformation. ( the section called “ Tree Editing Page ” )

Fourth parameter Stylesheet defines whether No Stylesheet is used or if a Link Stylesheet is used, or if a Inline stylesheet is used.

Parameter Stylesheet Path is optional, but needed if Link Stylesheet or Inline Stylesheet was selected. It defines the path to the local css file or a URL to a remote css file.

The last two optional parameter allow the user to filter the input models of the configuration space. The Model Type Filter allows the user to filter the input models regarding their type. Additionally the parameter Model Name Filter allows the user to specify a regular expression, which is used to filter the models by their names.


The directed graph export format generates a model graphs in the DOT language and with appropriate tools installed also images in many other image format such as JPEG, PNG, BMP. This can be used for generation of images for use in documentation or for printing. If the DOT language interpreter from the GraphViz package ( http://www.graphviz.org/) is installed in the computers executable path or the packages location is provided as a preference (Windows->Preferences->Variant Management->Image Export), many image formats can be generated directly. The dialog shown in Figure 6.52, “Directed graph export example” permits many details of the output, such as paper size or the layout direction for the model graph, to be specified. Graphs for sub-models may be exported by setting the root node to any model element. The Depth field is used to specify the distance below the root node beyond which no nodes are exported. The Colored option specifies whether Feature Models are exported with a colored feature background indicating the feature relation (yellow= ps:mandatory , blue= ps:or , magenta= ps:option , green= ps:alternative ). Figure 6.53, “Directed graph export example (options LR direction, Colored)” shows the results of a Feature Model export using the Left to Right graph direction and Colored options.



An Import item is provided in the Navigator and Variants Project views context menus and in the File menu. Select Variant Models or Projects from category Variant Management and choose one of the provided import sources.

Currently there exists following generic imports which are discussed below:

To learn more about how to import pure::variants server projets, see the documentation pure::variants Server Support Plug-In Manual. The Following steps explain how to import a Feature or a Family model from a CSV file accordingly:

While importing, a few fields are directly used by pure::variants to build the model. Other fields are imported as attributes to the elements. These fields are:


For importing a CSV to a Feature Model the field Unique Name is necessary. If you like to import a hierarchical model either the fields Unique ID and Parent Unique ID or Unique Name and Parent Unique Name are necessary as well. In case of importing an hierarchical model the element without Parent Unique ID will be the root element, if no Parent Unique IDs given, the first element without will be the model root.

Please note, the CSV export of pure::variants exports more fields as the CSV import of pure::variants can import. Fields such as Relations , Restriction and Constraint are ignored by CSV import. Therefore a full round trip with the help of the CSV data format is not possible.

The third generic import, imports a Feature Model from an Excel file. While importing a few fields are directly used by pure::variants to build the model.

The Excel file needs a specific structure so pure::variants can interpret the information and generate models automatically from an Excel file. See below example shows this structure.


All cells named with name "Features" are used as unique names for features during the import. Names, which contains newlines become hirarchical. Meaning first name is the parent name and names after the newline are becoming childs of the first feature.

Cells names with "Variants" are considered to define variants during the import. In this example three variants will be created: Indoor, Outdoor and Thermometer. Those variants will be created in a configuration space named "Variants". The Selections are created based on regular expressions, which can configured. By Default "X" and "x" are considered as selection and "-" is considered to be an Exclusion. All other values become values of an attribute called "value". Empty cells are considered as unselection of the corresponding element.

The cells of the "Types" named range define the variation types of the cerated features.

This table can be alligned vertical or horizontal and all names for the named ranges and regular expressions for the selections are configurable in the import wizard.

The Following steps explain how to import a feature model from an example excel file accordingly: