Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CapellaMBSE doesn't add necessary namespaces #242

Closed
Wuestengecko opened this issue Feb 3, 2023 · 0 comments
Closed

CapellaMBSE doesn't add necessary namespaces #242

Wuestengecko opened this issue Feb 3, 2023 · 0 comments
Assignees
Labels
model breaking Issues that pose the risk of breaking a model

Comments

@Wuestengecko
Copy link
Member

When creating objects from a new namespace (i.e. one that isn't already registered in the model), the namespace must be registered as xmlns:... on the root <Project> element. Not doing so results in a broken model which cannot be loaded in Capella, until either the namespace is registered or the offending element(s) removed.

In the same way, when removing the last element from a certain namespace, that namespace must be unregistered.

@Wuestengecko Wuestengecko added the model breaking Issues that pose the risk of breaking a model label Feb 3, 2023
@Wuestengecko Wuestengecko self-assigned this Feb 3, 2023
Wuestengecko added a commit that referenced this issue Feb 9, 2023
In order for the types of model elements to be correctly identifiable,
the namespace has to be defined on the fragment's respective root
element. This commit adds new methods for this purpose, and ensures that
`GenericElement.__init__` calls them with the correct values.

Fixes #242
Wuestengecko added a commit that referenced this issue Apr 15, 2024
The manual namespace management introduced in #242 was flawed: First, it
didn't support accurately versioning the introduced namespaces based on
the model's active viewpoints, and second, it had to be done manually in
several places (which it wasn't).

The new approach instead introduces a new method `update_namespaces`,
which is automatically called while saving to bring all namespace maps
up to date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model breaking Issues that pose the risk of breaking a model
Projects
None yet
Development

No branches or pull requests

1 participant