6.5.  Refactoring Models

To simplify the editing of Feature and Family Models pure::variants provides a set of refactoring operations. They support the user to efficiently change model objects like elements, relations, restrictions and attributes.

The refactoring operations can be accessed via the context menu of the Feature and Family Model Editors, see Figure 6.29, “Refactoring context menu for a feature” .

Figure 6.29. Refactoring context menu for a feature

Refactoring context menu for a feature

The refactoring operations provided in the context menu depend on the selection made in the editor. For instance, select two or more features and right-click on one of the selected features to open the context menu. The appearing Refactoring menu contains for example items for changing the variation type. This operation allows to modify the variation type for all selected features at once. Refactoring operations can include changes beyond the selected element on references in the selected scope. Therefor, refactoring operations can be long running actions. Furthermore it should be noted, that the appropriate rights have to be granted in all affected models and elements to ensure a successful operation. If access rights are missing a warning will be shown. Proceeding only on the models and elements where rights are sufficiently available, can result in references that are not updated.

The following list summarizes the available refactoring operations.

Table 6.2. Refactoring Operations

Operation onAvailable Operations
ElementsUnique Name
Extract
Delete
Variation Type Change
Element Type Change
Default-Selected State Change
Attributes Attribute Name, Type, and Value Change
Inheritable and Fixed State Change
Restrictions and Constraints Restriction/Constraint Code Change
RelationsRelation Type Change
Relation Targets Change

To extract an element or feature from a model, the target model has to exist. References to the extracted element or feature (via unique name or ID) will be updated in restrictions, constraints, and calculations with respect to the selected scope, e.g. the enclosing project, the project and all referenced projects, or the whole workspace. Depending on the scope and the amount and size of items to process, the refactoring operations can be long running actions.