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

New plug-in for validation in GEMOC Studio #164

Merged
merged 13 commits into from
Apr 15, 2020

Conversation

Kairides
Copy link
Contributor

@Kairides Kairides commented Apr 14, 2020

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)

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:

  • ERROR,
  • WARNING,
  • INFO and
  • DEFAULT

Each severity is displayed differently. A message with a severity ERROR will be displayed as an error in the GEMOC Studio,

error

a message with a severity WARNING will be displayed as a warning,

warning

a message with a severity INFO will be displayed as an information,

info

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,

metaprog

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

@dvojtise
Copy link
Contributor

ECA verified: need to squash and merge with Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>

CI build for verification: https://ci.eclipse.org/gemoc/job/gemoc-studio-integration/job/Kairides-pull_request_test/

@dvojtise
Copy link
Contributor

dvojtise commented Apr 14, 2020

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.
https://github.com/eclipse/gemoc-studio-modeldebugging/pull/164/files#diff-d4fc99d56cf970ea39137f3fad2f569b

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@Kairides
Copy link
Contributor Author

Kairides commented Apr 15, 2020

I have removed "plugin.xml" from the build.properties, I hope it will be enough.

@dvojtise
Copy link
Contributor

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants