Skip to content

fix: load model when loading model associations.#1120

Merged
andrewL-avlq merged 1 commit into
dsldevkit:masterfrom
andrewL-avlq:ACF-12752
Apr 29, 2025
Merged

fix: load model when loading model associations.#1120
andrewL-avlq merged 1 commit into
dsldevkit:masterfrom
andrewL-avlq:ACF-12752

Conversation

@andrewL-avlq
Copy link
Copy Markdown
Collaborator

The model associations are persisted as relations between model elements, so the model must exist when the associations are loaded from binary storage.

The model associations are persisted as relations between model
elements, so the model must exist when the associations are loaded from
binary storage.
DirectLinkingResourceStorageLoadable loadable = (DirectLinkingResourceStorageLoadable) ((DirectLinkingResourceStorageFacade) resource.getResourceStorageFacade()).getOrCreateResourceStorageLoadable(resource);
try {
// the associations are mappings from AST model elements to inferred model elements (and back) so we cannot skip loading the model.
ResourceSetOptions.setSkipModel(resource.getResourceSet(), false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we log a warning?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Isn't this just a load that was missed when the 'skipModel' option was added?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but that is a programming error, isn't it?

@andrewL-avlq andrewL-avlq merged commit dd59172 into dsldevkit:master Apr 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants