def get_libraries(system_engineering):
"""Gets the list of libraries for the given system engineering"""
res = []
if system_engineering is not None:
lib_cls = getattr(sys.modules["__main__"], "CapellaLibrary")
for value in getLibraries(system_engineering.get_java_object()):
lib = lib_cls(value)
res.append(lib)
But the class CapellaLibrary should then extends SystemEngineering. Because the Java SystemEngineering is loaded in the main project Sirius Session. Then we need to add a method get_capella_model() to load the libraries Sirius session. After that we will have two instances of the library in memory with different Objects (Python and Java). That will probably be confusing.
The method get_capella_model() should compute the .aird file from the resource URI replacing the .capella with .aird.
in Capella API:
But the class
CapellaLibrary
should then extendsSystemEngineering
. Because the JavaSystemEngineering
is loaded in the main project Sirius Session. Then we need to add a methodget_capella_model()
to load the libraries Sirius session. After that we will have two instances of the library in memory with different Objects (Python and Java). That will probably be confusing.The method
get_capella_model()
should compute the.aird
file from the resource URI replacing the.capella
with.aird
.