Reuse: Reconstruct custom type references to data dictionary when reusing element from library
Since #4346 (closed) all references from a library element are removed.
Currently, this only affects the type definition reference for ports. Here, this linkage to the DataDictionary should be reconstructed when instantiating a library component in a project. In case a type cannot be found, a warning should be displayed.
Alternatively, the library could also maintain the types explicitly and update the data dictionary whenever a library component is instantiated (#4150). In case #4150 is implemented, this issue here can be rejected.
Test procedure:
- Use this download Workspace.zip and insert the project directory and reuse directory into an empty AF3 workspace and open it in AF3.
- Go into component architecture of "TestWithEntriesPresent" and drop and drop the ReuseElement from the library "TestLibraryFor4347" into the architecture.
- Observe: The custom port types of Input1 and Output1 are valid and connected to the data dictionary (you can also look this up in the respective AF3 project file where the "def" property of the ports must have the type IDs of the data dictionary).
- Go into component architecture of "TestWithEntriesMissing" and drop and drop the ReuseElement from the library "TestLibraryFor4347" into the architecture.
- Observe: You get a summed up warning in a display window and also warnings in the console. They should inform you that the types of Input1 and Output1 could not be found (which is correct, because the data dictionary is still empty), and they should be added/updated in the data dictionary. After "Ok" you can also see that the types of these ports are empty (do not change them yet). When you save the project, you will also get errors in the marker view.
- Go into the data dictionar and insert the two missing type defs from the library "TestLibraryFor4347".
- Save the project and you will see that the errors in the marker view vanished and that the ports have now again the correct types. Only in the AF3 file, the "def" properties of the ports are not added yet (however, this does not seem to cause a problem in AF3).
- As a last point, you can also update in "TestWithEntriesMissing" the ReuseElement again from the library "TestLibraryFor4347". Right-click on the now present ReuseElement in the model navigator > "Reuse Manager" > "Update from Reuse Library" > Ok > Ok. In the end, you get also here the information to make sure that the two port types are up-to-date in the dictionary like you want them. Save the project.
- Observe that the two ports have still the correct types and now they also have the correct "def" properties in the actual AF3 file.
Edited by Sebastian Bergemann