It is not needed to create a new reuse library without any content.
This is why the possibility to create a new reuse library exists only during the dialog for adding a reuse element to a library.
In the first dialog window of adding a reuse element to a library, you can push at the bottom the button "Create new library".
The name of the reuse library needs to be chosen in the next window. it is not possible to choose a name which is already taken by another reuse library in the same workspace.
Afterwards, the process of adding a reuse element to a library will be continued, but the target reuse library will now be the newly created one.
Attention: If the process of adding a reuse element to a library is not successfully finished, the creation of the new reuse library will not be successful, too.
If, for whatever reason, you want to have an empty reuse library, you can create a reuse library with a dummy reuse element and then delete the dummy element via the reuse view.
Adding an element to a reuse library
If you have a possible reuse element and want to store it in a reuse library, you just need to start and follow the following dialog wizard.
If the wanted reuse library does not exist yet, you can create it during the adding process (see here).
Right click on the possible reuse element in the model navigator to open the standard element context menu.
In this menu you can find the entry "Add to Reuse Library". Select it and follow the upcoming dialog.
You will first need to specify the target library (or create a new one).
Afterwards, you will need to choose the name with which the element should be stored in the library. You cannot choose names of already existing reuse elements in the same library.
If your element contains external references, an additional dialog window will appear and help you managing these references for the reuse.
Finally, a deep copy of your element will be stored in the selected library and the original element should have a reference to it.
You can check that by looking into the model elements view or the reuse view and see if the new element appears there in the correct library. Maybe you need to refresh the views first.
To check the reuse reference/specification of the original element, you can open again the context menu of this element in the model navigator and control if it has new entries for updating its referenced library element and updating itself via the library element.
Reusing an element from a reuse library
As soon as you have saved a reuse element in a reuse library (or received a library with reuse elements from other developers), you can reuse it everywhere as long as its type fits to the target place (e.g. a component can be reused in a component architecture but not in a requirement list).
In order to reuse the element, you just select it in the model elements view (usually in the right side). With a drag and drop you can then place it where you want it in the same way as for any standard model elements.
However, in contrast to the standard elements, the placed element will have already all the content of the original element that was reused, and it will have a reuse reference/specification to its origin in the reuse library.
Through this reference, it is now always possible to get all updates/modifications of the original reuse element and also to update the origin yourself.
If the wanted element for reuse is not shown in the model elements view, it is either not correctly added to a reuse library that is present in the current workspace, or it does not fit to the current active editor.
If you for example have the component editor open, you can only see all possible reuse components but no reuse entries for the data dictionary.
If you open the data dictionary editor, you will not see anymore the reusable components but now the reusable data dictionary entries are visible in the model elements view.
Updating an element inside a reuse library
If a possible reuse element was copied/added into a reuse library or if it is a reuse element that was reused out of a library, it has always a reference to its counterpart in the reuse library.
Via this reference, it is now possible to update the counterpart inside the reuse library with the current (probably updated) version of the reuse element in the project.
This can be done by right-clicking on the respective element in the model navigator and choosing the "Update In Reuse Library" entry in the opened context menu. A dialog wizard will open up and guide you through the update.
If the element has multiple references to libraries, the first request will be about the target library. Afterwards, an overview is given about what will be updated with what and where. When this was confirmed, an option to change the name of the element in the library will open and finally the update will be executed.
If your element contains external references, an additional dialog window will appear and help you managing these references for the reuse. If the reuse reference to the library is outdated and the reuse element cannot be found in the library, you will get this information, the update process will be cancelled and the wrong reference will be removed.
If a possible reuse element was copied/added into a reuse library or if it is a reuse element that was reused out of a library, it has always a reference to its counterpart in the reuse library.
Via this reference, it is now possible to update the reuse element in the project with the current (probably updated) version of its counterpart inside the reuse library.
This can be done by right-clicking on the respective element in the model navigator and choosing the "Update From Reuse Library" entry in the opened context menu. A dialog wizard will open up and guide you through the update.
If the element has multiple references to libraries, the first request will be about the target library (which is then actually the source of the update). Afterwards, an overview is given about what will be updated with what and where. When this was confirmed, an option to change the name of the reused element in the project will open and finally the update will be executed.
If your element contains external references, an additional dialog window will appear and help you managing these references for the reuse. If the reuse reference to the library is outdated and the reuse element cannot be found in the library, you will get this information, the update process will be cancelled and the wrong reference will be removed.
Together with updating a referenced library element it is now possible to quickly propagate new changes of an element to its reused twin elements via the reuse libraries.
Managing the reuse libraries and their element
To be able to easily manage the reuse libraries and elements, we have implemented a dedicated view/editor for the reuse feature.
As it is shown in the pictures in the section about reuse libraries and below, this editor is a table containing (in separate rows) all found reuse libraries in the current workspace. The library rows can be unfolded and will then also present the contained reuse elements in sub-rows.
The editor should be instantiated automatically when starting the AF3 environment. It is located by default in the bottom panel as a separate tab called "Reuse Libraries".
If it is not there, you can open it by searching for "Reuse" with Ctrl+3 and selecting the "Reuse Libraries" in the view category. However, the editor should be opened and actively displayed every time when a reuse action is executed (independent of being already existent or not).
Besides showing the names of the reuse libraries and their reuse elements, the table also provides information about the related UUIDs, comments and when the related objects were updated the last time.
With the help of the editor, it is possible to rename or delete single reuse elements or whole reuse libraries by right-clicking on the respective names and choosing the wanted action from the context menu.
The comments can be modified by directly double-clicking into the comment cell of the wanted object.
If a reuse library was updated externally or added as folder into the workspace during runtime, it will not be shown automatically in the editor.
To achieve this, the button "Refresh Libraries" needs to be pushed in the top left corner of the editor. The time of the last refresh is shown on the right side of the button.
Finally, it is possible to search for text in all the cells of the editor via the search box in the top left corner of the editor.
With this help you can for example find libraries and reuse elements updated on a specific date or find all reusable controller components across all libraries (if you added all of them with "controller" in their name).