Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Skipping validations of features from EMF Model
Skipping validations of features from EMF Model [message #995815] Mon, 31 December 2012 07:18 Go to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

I am creating DSL for existing EMF Model who persistence format is xmi. The DSL will be just an alternate representation of xmi format.

The DSL contains many less features because i want only relevant features available to user and system specific stuff is kept hidden.
These features in DSL are marked optional in grammar. But they are not optional in ECore model.

Hence in the DSL i see error reporting that "... feature is not optional and should be specified ...". One way is to change the ECore model but I can't do this because i don't have authorizations to change the ECore model. Is it possible to skip these validation errors ?

Regards,
Ashwani Kr Sharma
Re: Skipping validations of features from EMF Model [message #999616 is a reply to message #995815] Sat, 12 January 2013 17:10 Go to previous messageGo to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

I am kinna stuck with this issue. Can you please give some hints.

Regards,
Ashwani Kr Sharma
Re: Skipping validations of features from EMF Model [message #1000197 is a reply to message #995815] Mon, 14 January 2013 08:38 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 31.12.12 08:18, schrieb Ashwani Kr Sharma:
> Hi,
>
> I am creating DSL for existing EMF Model who persistence format is xmi.
> The DSL will be just an alternate representation of xmi format.
>
> The DSL contains many less features because i want only relevant
> features available to user and system specific stuff is kept hidden.
> These features in DSL are marked optional in grammar. But they are not
> optional in ECore model.
>
> Hence in the DSL i see error reporting that "... feature is not optional
> and should be specified ...". One way is to change the ECore model but I
> can't do this because i don't have authorizations to change the ECore
> model. Is it possible to skip these validation errors ?
>
> Regards,
> Ashwani Kr Sharma

Yes, you may skip the EObjectValidator in case you validate your
language files. See
org.eclipse.xtext.validation.CompositeEValidator.useEObjectValidator

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Skipping validations of features from EMF Model [message #1006986 is a reply to message #1000197] Sun, 03 February 2013 15:10 Go to previous messageGo to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi Sebastian,

Where do i specify org.eclipse.xtext.validation.CompositeEValidator.useEObjectValidator ?
In mwe2 file ?

Regards,
Ashwani Kr Sharma
Re: Skipping validations of features from EMF Model [message #1006990 is a reply to message #1006986] Sun, 03 February 2013 15:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

adding a simple straight forward binding to the runtime module doesnt work?

public void configureUseEObjectValidator(Binder binder) {
binder.bind(Boolean.class)
.annotatedWith(
Names.named(CompositeEValidator.USE_EOBJECT_VALIDATOR))
.toInstance(Boolean.FALSE);
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Skipping validations of features from EMF Model [message #1010297 is a reply to message #1006990] Sun, 17 February 2013 04:21 Go to previous messageGo to next message
Ashwani Kr Sharma is currently offline Ashwani Kr SharmaFriend
Messages: 119
Registered: July 2009
Location: Bangalore, India
Senior Member

Hi,

I have put following method in my RuntimeModule class. But nothing changes:

public void configureUseEObjectValidator(Binder binder) {
binder.bind(Boolean.class).annotatedWith(Names.named(CompositeEValidator.USE_EOBJECT_VALIDATOR)).toInstance(Boolean.FALSE);
}


I read the documentation of xText and following is mentioned there. So, can't we skip them ?
Quote:
The IConcreteSyntaxValidator validates all constraints that are implied by a grammar.
Meeting these constraints for a model is mandatory to be serialized.


Regards,
Ashwani Kr Sharma

[Updated on: Sun, 17 February 2013 04:55]

Report message to a moderator

Re: Skipping validations of features from EMF Model [message #1010437 is a reply to message #1010297] Sun, 17 February 2013 09:30 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

so are we talking about two things?

first you where talking about mandatory things in the metamodel that do not appear in the grammar, not you are talking about mandatory things in the grammar that dont appear in the model?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Empty rule
Next Topic:XMI resource to xText resource
Goto Forum:
  


Current Time: Tue Apr 16 19:07:22 GMT 2024

Powered by FUDForum. Page generated in 0.68805 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top