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

Implement a custom model validation provider for CAL #55

Closed
Tracked by #28 ...
Gelio opened this issue Nov 14, 2021 · 1 comment · Fixed by #57
Closed
Tracked by #28 ...

Implement a custom model validation provider for CAL #55

Gelio opened this issue Nov 14, 2021 · 1 comment · Fixed by #57
Labels
complexity: medium P1 High priority scope: model validation Issues related to validating models thesis-required Issue must be closed to complete the thesis

Comments

@Gelio
Copy link
Owner

Gelio commented Nov 14, 2021

Based on the investigation from #33, implement a model validation provider (a class that implements IValidationDescriptionProvider) for additional semantic CAL model validations.

Idea

There will be a new interface

interface ISemanticCALValidationRule {
  List<Diagnostic> validate(ComputationApplicationRelease application);
}

Each semantic rule (e.g. #27) will implement it.

The SemanticCALValidationDescriptionProvider will receive a list of ISemanticCALValidationRules and propagate the concatenated diagnostics returned by running each rule.

Resources

@Gelio
Copy link
Owner Author

Gelio commented Nov 16, 2021

I was wrong - implementing a new IValidationDescriptionProvider will not show the validations, because the code in SIrius Components handles only a single IValidationDescriptionProvider:

https://github.com/eclipse-sirius/sirius-components/blob/ab8097c6c3593f10fdd16f9212762624a3639ccc/backend/sirius-web-spring-collaborative-validation/src/main/java/org/eclipse/sirius/web/spring/collaborative/validation/ValidationEventProcessorFactory.java#L50-L52

As a result, I need to modify the code of the existing [ValidationDescriptionProvider](https://github.com/Gelio/CAL-web/blob/main/backend/sirius-web-services/src/main/java/org/eclipse/sirius/web/services/validation/ValidationDescriptionProvider.java to include running custom semantic validations.

Gelio added a commit that referenced this issue Nov 16, 2021
Modify the ValidationDescriptionProvider to additionally run CAL
semantic validation rules and emit their diagnostics.

A CAL semantic validation rule receives a
`ComputationApplicationRelease` and returns a list of diagnostics for
that object. It can use EMF metamodel's methods and properties to come
up with those diagnostics.

There are no new semantic validation rules in this commit. They will be
added in future commits.

Closes #55
@Gelio Gelio closed this as completed in #57 Nov 16, 2021
@Gelio Gelio added the thesis-required Issue must be closed to complete the thesis label Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: medium P1 High priority scope: model validation Issues related to validating models thesis-required Issue must be closed to complete the thesis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant