The procedures described here are part of a PROTOTYPE implementation

Moving existing elements to a Library

This PROTOTYPE makes it possible to move elements from a project to a library. (Moving elements from a library to a project will be supported soon). Feel encouraged to report feedback in this bugzilla:

Project Explorer Drag & Drop

For simple move operations, drag and drop the element to be moved from the project to a suitable location in the library. However, sometimes such an action would violate referential integrity: for example when you are trying to move a Class A which extends from another Class B to a library, while Class B remains in the project. Since an element in a library can never reference an element in a project, the drop cannot be completed and a warning dialog will open. One could instead select A and B and move them together, but this is only possible because A and B are elements of the same Type.

The Move Elements View (see below) allows to move multiple elements with distinct types and references between each other in a single undoable operation. Note however that this method does not currently execute semantic validation (see below), so you may end up with illegal references in your model.

If you're unsure whether a move would introduce an illegal reference, better use the new Move Elements view or execute validation rule I_38 (which is disabled by default) on your model after you're done moving elements.

Move Elements View

When the Move Elements View (Window->Show View->Capella (Incubation)->Move Elements View) is opened for the first time, it looks like this:

1. The Selection Area shows all elements that should be moved in bold. Drag/Drop model elements from the Capella Project Explorer over this area to fill the view. To remove a selected element from the view, click the small 'x' on the right side of the Selection Area.

2. The Destination Area shows the possible destinations for elements in the selection area. To set a new destination for a selected element, drag/drop the element from the selection area over a suitable parent in the destination area. Elements in the selection area for which a destination element has been selected will appear in green. To clear an already set destination for a selected element, click the small 'x' on the right side of the Destination Area.

3. The execute button is initially disabled. As soon as a destination is set for all selected elements, and no referential problems (see below) are detected, the execute button will be enabled. Selecting the button executes performs semantic validation (see below) and executes the move operation unless semantic validation detected a problem.

4. It is also possible to reset the view by selecting the reset button.

Illegal Backreferences

Sometimes it is not possible to move a single element without moving other related elements, such as in the initial example of Class A extending Class B. When Class A is dropped onto the Selection Area, this problem is detected and presented by drawing the Generalization child of A in red. Hovering over the element will show additional informations on this illegal backreference:

As long as one or more illegal backreferences are present, the execute button remains disabled. There are always multiple solutions to an illegal backreference: In this case, either add Class B to the Selection Area, or remove the Generalization element from the model. The view detects changes to the model and re-calculates backreferences automatically.

Semantic Validation

When the execute button is clicked, all selected elements are moved to their new destination, and the semantic validation is performed:

If the semantic validation phase detects one of the errors described above, an error dialog opens and the move action is aborted.