Skip to content

Variability4TOSCA Feature IDE Integration 1.0 Release Candidate

This document specifies the integration of FeatureIDE into the Variability4TOSCA specification. The specification is under active development and is not backwards compatible with any previous versions.

FeatureIDE Integration

In order to generate only valid service templates, feature models can be used to model dependencies between variability inputs. A feature model of Feature IDE is supposed to be packaged as feature-model.xml at the root of the CSAR. We describe the mapping between the Extended XML Configuration to variability inputs.

Features

Each feature is mapped to a Boolean variability input. The value is true if either automatic or manual is selected. Otherwise, the value is false. Thereby, the feature name is transformed to lowercase and all whitespaces are replaced with an underscore.

<feature automatic="selected" manual="selected" name="Feature A"/>
feature_a: true

Feature names can be overridden by the value of the attribute __name.

1
2
3
<feature automatic="undefined" manual="selected" name="Feature C">
    <attribute name="__name" value="feature_overridden"/>
</feature>
feature_overridden: true

Attributes

Each attribute is mapped to a variability input. The values are parsed by a JSON parser. If parsing throws an error, then the value is treated as a string.

The attribute name is namespaced by their feature, transformed to lowercase and all whitespaces are replaced with an underscore.

1
2
3
<feature automatic="undefined" manual="selected" name="Feature A">
    <attribute name="attr_bool_true" value="true"/>
</feature>
feature_a_attr_bool_true: true

Attribute names can be overridden by the value of the attribute __name_${attribute name}.

1
2
3
4
<feature automatic="undefined" manual="selected" name="Feature D">
    <attribute name="attr Long" value="1"/>
    <attribute name="__name_attr_long" value="attr_overridden"/>
</feature>
feature_d_attr_overridden: true

The full attribute name (including the feature namespacing) can be overridden by the value of the attribute __full_name_${attribute name}.

1
2
3
4
<feature automatic="undefined" manual="selected" name="Feature E">
    <attribute name="attr_another_string" value="something else"/>
    <attribute name="__full_name_attr_another_string" value="fully_overridden"/>
</feature>
fully_overridden: something else

Example

The following example of a complete FeatureIDE Extended XML Configuration contains examples of the above introduced concepts.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<extendedConfiguration>
    <feature automatic="selected" manual="undefined" name="Application"/>
    <feature automatic="selected" manual="selected" name="Feature A">
        <attribute name="attr_bool_true" value="true"/>
        <attribute name="attr_bool_false" value="false"/>
        <attribute name="attr LoNg" value="3"/>
        <attribute name="attr_double" value="2.5"/>
        <attribute name="attr_string" value="hello world"/>
    </feature>
    <feature automatic="undefined" manual="undefined" name="Feature B"/>
    <feature automatic="undefined" manual="selected" name="Feature C">
        <attribute name="__name" value="feature_overridden"/>
    </feature>
    <feature automatic="undefined" manual="selected" name="Feature D">
        <attribute name="attr Long" value="1"/>
        <attribute name="__name_attr_long" value="attr_overridden"/>
    </feature>
    <feature automatic="undefined" manual="selected" name="Feature E">
        <attribute name="__name" value="feature_another_overridden"/>
        <attribute name="attr_double" value="1337"/>
        <attribute name="attr_string" value="something"/>
        <attribute name="__name_attr_string" value="attr_also_overridden"/>
        <attribute name="attr_another_string" value="something else"/>
        <attribute name="__full_name_attr_another_string" value="fully_overridden"/>
    </feature>
</extendedConfiguration>
application: true

feature_a: true
feature_a_attr_bool_true: true
feature_a_attr_bool_false: false
feature_a_attr_long: 3
feature_a_attr_double: 2.5
feature_a_attr_string: 'hello world'

feature_b: false

feature_overridden: true

feature_d: true
feature_d_attr_overridden: 1

feature_another_overridden: true
feature_another_overridden_attr_double: 1337
feature_another_overridden_attr_also_overridden: something
fully_overridden: something else

To run the transformation using our reference implementation, run the following command.

vintner template inputs --path path/to/my-inputs.xml --output result.yaml

Reference Implementation

We provide a reference implementation for this specification as part of OpenTOSCA Vintner. OpenTOSCA Vintner is a TOSCA preprocessing and management layer. The project is open-source, licensed under Apache-2.0, and publicly available at GitHub.

Acknowledgments

This specification is developed for the purpose of research by the Institute of Software Engineering (ISTE) and the Institute of Architecture of Application Systems (IAAS) of the University of Stuttgart, Germany. The development is partially funded by the German Federal Ministry for Economic Affairs and Climate Action (BMWK) as part of the Software-Defined Car (SofDCar) project (19S21002).

Correspondence

Please address all correspondence concerning this specification to Miles Stötzner <miles.stoetzner@iste.uni-stuttgart.de, https://miles.stoetzner.de>.

Disclaimer of Warranty

Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.


Last update: November 18, 2024