-
Notifications
You must be signed in to change notification settings - Fork 15
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
New plug-in for validation in GEMOC Studio #164
Conversation
…ava correspondant
… the metaprog entry
Signed-off-by: Kairides <gueguen.ronan1@gmail.com>
ECA verified: need to squash and merge with CI build for verification: https://ci.eclipse.org/gemoc/job/gemoc-studio-integration/job/Kairides-pull_request_test/ |
need some fix: [ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:1.5.1:package-plugin (default-package-plugin) on project org.eclipse.gemoc.dsl: /home/jenkins/agent/workspace/ation_Kairides-pull_request_test/gemoc-studio-modeldebugging/commons/plugins/org.eclipse.gemoc.dsl/build.properties: bin.includes value(s) [plugin.xml] do not match any files. You've added "plugin.xml" to the build.properties but there is no such file in the project. |
Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
I have removed "plugin.xml" from the build.properties, I hope it will be enough. |
Looks good to me |
To perform validation on DSLs during their creation, whatever the meta-programming approach used, we have created an Eclipse extension point allowing other plug-ins to add validation rules to the DslValidator.
The extension point provides two interfaces, two classes and an enumeration used by the plug-ins that extends the extension poinr to create rules and add them to the DslValidator.
![class_diagram(v3)](https://user-images.githubusercontent.com/37030663/79211282-58bfd980-7e46-11ea-889f-70d57924b580.png)
The first inteface is IRuleProvider, this interface provides validation rules to be performed by the DslValidator. These validation rules implement the second interface.
The second interfce IRule, allows to perform checks on a DSL and its entries, it send back a message that the DslValidator will then display on the GEMOC Studio. These messages are instances of the Message class.
The Message class allows the validation rules to send information regarding the creation of a DSL, according to a specific meta-programming approach, to the DslValidator. A message sent by a validation rule can for instance mention the lack of an Ecore meta-model, if the chosen meta-programming approach uses an Ecore meta-model. These messages use a severity to indicate to the DslValidator how to display them on the GEMOC Studio, the different possible values for the severity are provided by the Severity enumeration.
The Severity enumeration allow the DslValidato to know of what type a message sent by a validation rule is, this enumeration provides four values:
Each severity is displayed differently. A message with a severity ERROR will be displayed as an error in the GEMOC Studio,
a message with a severity WARNING will be displayed as a warning,
a message with a severity INFO will be displayed as an information,
and a message with a severity DEFAULT won't be displayed as this severity is used if a validation rule does not detect anything abnormal for its meta-programming approach.
Another class is provided by the extension point. This class EcoreRule, provide checks on the "ecore" entry in the dsl file for meta-programming approaches that use Ecore meta-model.
To use these RuleProviders, we have added a mandatory entry "metaprog" for the dsl file,
this entry takes the name of a meta-programming approach implemented added to GEMOC and gather the RuleProvider this approach provides.
The DslValidator will then perform its regular checks then execute every validation rules th RuleProvider gave and display their message on the GEMOC Studio.
Example of an AleRuleProvider and AleRule: https://gist.github.com/Kairides/3d3f94928ee99a5ac42107fa88c5956f
signed-off-by Ronan Guéguen gueguen.ronan1@gmail.com