Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Custom validation failure messages
Custom validation failure messages [message #671951] Thu, 19 May 2011 12:43 Go to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi,

after reading the discussion here, I tried the feature of defining custom messages for the validation myself. Although I followed the steps mentioned there, I still didn't get to see my message when constraints are violated.

I checked this bug and read pages 87-88 from this presentation, to be sure I'm not omitting something. The custom messages are simply not shown in my xtext editor.

Here's what I tried: after defining an invariant, I wanted to show a custom message when the validation returns an error, something like (in oclinecore)

invariant OrdinalIsUnique('Ordinals must be unique.'): 
	ElemA.allInstances()->excluding(self).ordinal->excludes(ordinal);


or, in Ecore

<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
  <details key="OrdinalIsUnique" value="(((ElemA.allInstances())->excluding(self))->collect(ordinal))->excludes(ordinal)"/>
  <details key="OrdinalIsUnique$message" value="'Ordinals must be unique.'"/>
</eAnnotations>


but the custom message is not shown in the xtext editor. If I define

ElemA one (
    ordinal 0
)

ElemA two (
    ordinal 1
)

ElemA three(
    ordinal 0 // not valid, according to the invariant
)


the marker is shown at the right line and the validation returns the following error:

The 'OrdinalIsUnique' constraint is violated on 'MyDSL.impl.ElemAImpl @ 677646{platform:/resource/TestOCLXtext2/src/basic.MyDSL#//@elements.0}'

which is correct, because the constraint is, indeed, violated. But why isn't my message shown? As I said, my generated validator inherits OCLinEcoreEObjectValidator, I checked that the class is not generated and I added org.eclipse.ocl.examples.xtext.oclinecore as a dependency in the manifest. In my case, it does not work.

Tested with:

Eclipse Indigo Build id: 20110505-1223
Xtext 2.0.0.v201105170444
OCL 3.1.0.v20110502-1445

Any clues why this might still not work?

Thanks in advance.

Darie
Re: Custom validation failure messages [message #671954 is a reply to message #671951] Thu, 19 May 2011 12:56 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Updating the OCL to the RC1 from the update site http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/3.1.0 didn't help either. The custom message still does not appear in the xtext editor.
Re: Custom validation failure messages [message #672196 is a reply to message #671954] Fri, 20 May 2011 09:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi Darie

Sorry for the slow reply. I've been testing the RC1 tooling by using it
to modelize the OCL specification as a preliminary to auto-generation
thereof; pretty successfully though I have quite a few good-to-do's for RC2.

I'll try to make sure any bit rot that has set in on custom messages is
fixed for RC2 too. New tutorials and example projects should then appear
in RC3.

Regards

Ed Willink


On 19/05/2011 13:56, Darie wrote:
> Updating the OCL to the RC1 from the update site
> http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/3.1.0
> didn't help either. The custom message still does not appear in the
> xtext editor.
Re: Custom validation failure messages [message #672370 is a reply to message #672196] Fri, 20 May 2011 20:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi Darie

Yes, the bit rot had set in.

The NoEObjectCompositeEValidator class was a workaround because I didn't
know how to exploit field injection. Once Sven explained that

public Class<? extends CompositeEValidator> bindCompositeEValidator() {
return NoEObjectCompositeEValidator.class;
}

could be replaced by

@Override
public void configure(Binder binder) {
super.configure(binder);

binder.bindConstant().annotatedWith(Names.named(org.eclipse.xtext.validation.CompositeEValidator.USE_EOBJECT_VALIDATOR)).to(false);
}

I deleted the redundant class, so the tutorial is broken on M7 and RC1.

You may do the replacement above in your XXXRuntimeModule, or wait till
RC2 for which I've re-instated but deprecated NoEObjectCompositeEValidator.

Sorry for the trouble. Thanks for the notification.

Regards

Ed Willink


On 20/05/2011 10:26, Ed Willink wrote:
> Hi Darie
>
> Sorry for the slow reply. I've been testing the RC1 tooling by using
> it to modelize the OCL specification as a preliminary to
> auto-generation thereof; pretty successfully though I have quite a few
> good-to-do's for RC2.
>
> I'll try to make sure any bit rot that has set in on custom messages
> is fixed for RC2 too. New tutorials and example projects should then
> appear in RC3.
>
> Regards
>
> Ed Willink
>
>
> On 19/05/2011 13:56, Darie wrote:
>> Updating the OCL to the RC1 from the update site
>> http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/3.1.0
>> didn't help either. The custom message still does not appear in the
>> xtext editor.
>
Re: Custom validation failure messages [message #672472 is a reply to message #672370] Sat, 21 May 2011 07:29 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi Ed,

thank you very much for your time. It's no big deal doing that replacement, but I think I'll wait for the RC2. Anyway, thanks for the tip!

Have a nice weekend.

Darie
Re: Custom validation failure messages [message #673599 is a reply to message #672472] Tue, 24 May 2011 08:31 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi Ed,

I made the replacement, just to see if it works. And it does, indeed. The custom messages are shown as warnings. By the way, is there a possibility to customize the type of the message (i.e. warning/error/information)? It's really not important, it just came into my head.

Regards,

Darie
Re: Custom validation failure messages [message #673625 is a reply to message #673599] Tue, 24 May 2011 09:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi Darie

Yes. See the asError() wrapper that exploits the 'value' of the invariant.

def: asError(verdict : Boolean) : Boolean =
if verdict then true else null endif

true = success
false = warning
null = failure
invalid = disaster

Regards

Ed Willink

On 24/05/2011 09:31, Darie wrote:
> Hi Ed,
>
> I made the replacement, just to see if it works. And it does, indeed.
> The custom messages are shown as warnings. By the way, is there a
> possibility to customize the type of the message (i.e.
> warning/error/information)? It's really not important, it just came
> into my head.
>
> Regards,
>
> Darie
Re: Custom validation failure messages [message #673692 is a reply to message #673625] Tue, 24 May 2011 13:38 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi Ed,

thank you very much!

Regards,

Darie
Re: Custom validation failure messages [message #1059449 is a reply to message #672370] Sat, 18 May 2013 17:20 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

Ed Willink wrote on Fri, 20 May 2011 17:38

@Override
public void configure(Binder binder) {
super.configure(binder);

binder.bindConstant().annotatedWith(Names.named(org.eclipse.xtext.validation.CompositeEValidator.USE_EOBJECT_VALIDATOR)).to(false);
}


Is it still valid on Juno SR2? I can't make it work with the following tooling, and can't find out if it's either incompatibility or a silly mistake:

* Eclipse Juno
Version: 4.2.2
Build id: M20130204-1200

* Eclipse Modeling Framework Runtime and Tools
Version: 2.8.3.v20130125-0826
Build id: R201301250826

* Xtext SDK
Version: 2.4.1.v201304180855

* OCL (Object Constraint Language)
Version: 3.2.2.v20130128-1158
Build id: M201301281158


The source code (and more details) is available at this github repo: https://github.com/juniorz/playing-with-eclipse-mdt

Thanks for any help!
Re: Custom validation failure messages [message #1059504 is a reply to message #1059449] Mon, 20 May 2013 06:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi

Your Library.xmi and Library.ecore are simpler than Tutorial.xmi and
Tutorial.ecore.

In particular Library.xmi has only one load so has no errors. Cloning
the load three times and it fails as expected.

Regards

Ed Willink

On 18/05/2013 18:20, Reinaldo Junior wrote:
> Ed Willink wrote on Fri, 20 May 2011 17:38
>> @Override
>> public void configure(Binder binder) {
>> super.configure(binder);
>> binder.bindConstant().annotatedWith(Names.named(org.eclipse.xtext.validation.CompositeEValidator.USE_EOBJECT_VALIDATOR)).to(false);
>> }
>
>
> Is it still valid on Juno SR2? I can't make it work with the following
> tooling, and can't find out if it's either incompatibility or a silly
> mistake:
>
> * Eclipse Juno Version: 4.2.2 Build id: M20130204-1200
>
> * Eclipse Modeling Framework Runtime and Tools Version:
> 2.8.3.v20130125-0826 Build id: R201301250826
>
> * Xtext SDK Version: 2.4.1.v201304180855
>
> * OCL (Object Constraint Language) Version: 3.2.2.v20130128-1158
> Build id: M201301281158
>
>
> The source code (and more details) is available at this github repo:
> https://github.com/juniorz/playing-with-eclipse-mdt
>
> Thanks for any help!
Re: Custom validation failure messages [message #1059632 is a reply to message #1059504] Tue, 21 May 2013 00:39 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

I guess I haven't elaborated it properly.

I'm able to violate the OCL constraint (by creating multiple loans) on both xmi and xtext files but I'm not able to see the custom message ("not enough copies") as specified in the ecore file (https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/model/Library.ecore#L24)

I've followed the instructions provided in the presentation (and summarised in this topic):

1. Change the Xtext validator to inherit from OCLinEcoreEObjectValidator - https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/src/tutorial/util/TutorialValidator.java#L27
2. Override the configure method on XXXRuntimeModule - https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial.xtext/src/org/eclipse/oclinecore/tutorial/xtext/LibraryDslRuntimeModule.java#L15

If I override the configure method, I have no validation at all. If I don't do it, I see the usual "The 'CONSTRAINT_NAME' constraint is violated on 'OBJECT NAME'" message.

I'm using the latest Eclipse modeling release (a version different from the used in the tutorial).

Thank you

[Updated on: Tue, 21 May 2013 21:02]

Report message to a moderator

Re: Custom validation failure messages [message #1059820 is a reply to message #1059632] Tue, 21 May 2013 18:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi

You need to use the OCLinEcoreEObjectValidator , which you are
source-wise, but you also need to use it at run-time, so you must run in
a nested Eclipse.

When I do that and fix JRE consistency, rebuild to expose the icons, I
get failures from a CDO CCE. I've never seen CDO in action so I'll look
a little further, but ...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=408615 raised against CDO.

That fixed it still doesn't work. Changing the nsURI and rebuilding
fixes it.

Using the same URI for your example as for the original tutorial is very
very foolish (and 'illegal'; org.eclipse... is reserved for Eclipse
Foundation usage).

Regards

Ed Willink


On 21/05/2013 01:39, Reinaldo Junior wrote:
> I guess I haven't elaborated it properly.
>
> I'm able to violate the OCL constraint (by creating multiple loans) on
> both xmi and xtext files but I'm not able to see the custom message
> ("not enough copies") as specified in the ecore file
> (https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/model/Library.ecore#L24)
>
> I've followed the instructions provided in the presentation (and
> summarised in this topic):
>
> 1. Change the Xtext validator to inherit from
> OCLinEcoreEObjectValidator -
> https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/src/tutorial/util/TutorialValidator.java#L27
> 2. Override the configure method on XXXRuntimeModule[/url] -
> https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial.xtext/src/org/eclipse/oclinecore/tutorial/xtext/LibraryDslRuntimeModule.java#L15
>
> If I override the configure method, I have no validation at all. If I
> don't do it, I see the usual "The 'CONSTRAINT_NAME' constraint is
> violated on 'OBJECT NAME'" message.
>
> I'm using the latest Eclipse modeling release (a version different
> from the used in the tutorial).
>
> Thank you
Re: Custom validation failure messages [message #1059822 is a reply to message #1059820] Tue, 21 May 2013 18:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
You've also missed the<br>
<br>
Note the <span class="bold"><strong>@generated not</strong></span>
that indicates that the class interface is manually defined. Do
not use <span class="bold"><strong>@generated NOT</strong></span>
since that indicates that the whole class is manually defined.<br>
<br>
comment in the (current) documentation.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
On 21/05/2013 19:01, Ed Willink wrote:<br>
</div>
<blockquote cite="mid:kngcps$ui4$1@xxxxxxxxe.org" type="cite">Hi
<br>
<br>
You need to use the OCLinEcoreEObjectValidator , which you are
source-wise, but you also need to use it at run-time, so you must
run in a nested Eclipse.
<br>
<br>
When I do that and fix JRE consistency, rebuild to expose the
icons, I get failures from a CDO CCE. I've never seen CDO in
action so I'll look a little further, but ...
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=408615">https://bugs.eclipse.org/bugs/show_bug.cgi?id=408615</a> raised
against CDO.
<br>
<br>
That fixed it still doesn't work. Changing the nsURI and
rebuilding fixes it.
<br>
<br>
Using the same URI for your example as for the original tutorial
is very very foolish (and 'illegal'; org.eclipse... is reserved
for Eclipse Foundation usage).
<br>
<br>
    Regards
<br>
<br>
        Ed Willink
<br>
<br>
<br>
On 21/05/2013 01:39, Reinaldo Junior wrote:
<br>
<blockquote type="cite">I guess I haven't elaborated it properly.
<br>
<br>
I'm able to violate the OCL constraint (by creating multiple
loans) on both xmi and xtext files but I'm not able to see the
custom message ("not enough copies") as specified in the ecore
file
(<a class="moz-txt-link-freetext" href="https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/model/Library.ecore#L24">https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/model/Library.ecore#L24</a>)<br>
<br>
I've followed the instructions provided in the presentation (and
summarised in this topic):
<br>
<br>
1. Change the Xtext validator to inherit from
OCLinEcoreEObjectValidator -
<a class="moz-txt-link-freetext" href="https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/src/tutorial/util/TutorialValidator.java#L27">https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial/src/tutorial/util/TutorialValidator.java#L27</a><br>
2. Override the configure method on XXXRuntimeModule[/url] -
<a class="moz-txt-link-freetext" href="https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial.xtext/src/org/eclipse/oclinecore/tutorial/xtext/LibraryDslRuntimeModule.java#L15">https://github.com/juniorz/playing-with-eclipse-mdt/blob/master/org.eclipse.oclinecore.tutorial.xtext/src/org/eclipse/oclinecore/tutorial/xtext/LibraryDslRuntimeModule.java#L15</a><br>
<br>
If I override the configure method, I have no validation at all.
If I don't do it, I see the usual "The 'CONSTRAINT_NAME'
constraint is violated on 'OBJECT NAME'" message.
<br>
<br>
I'm using the latest Eclipse modeling release (a version
different from the used in the tutorial).
<br>
<br>
Thank you
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>
Re: Custom validation failure messages [message #1059830 is a reply to message #1059820] Tue, 21 May 2013 19:01 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

Ed Willink wrote on Tue, 21 May 2013 15:01
Hi

You need to use the OCLinEcoreEObjectValidator , which you are
source-wise, but you also need to use it at run-time, so you must run in
a nested Eclipse.


Thank you Ed,

Does it mean I have to build my Xtext project from a nested Eclipse (started from running my Ecore project as an Eclipse application)? Why isn't enough to add the plugins which provides OCLinEcoreEObjectValidator as a dependency? Do you have any additional reference on that?

Quote:

That fixed it still doesn't work. Changing the nsURI and rebuilding
fixes it.

Using the same URI for your example as for the original tutorial is very
very foolish (and 'illegal'; org.eclipse... is reserved for Eclipse
Foundation usage).


I would never imagine this could make any harm.
Re: Custom validation failure messages [message #1059844 is a reply to message #1059822] Tue, 21 May 2013 20:55 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

Ed Willink wrote on Tue, 21 May 2013 15:05
<html>
<div class="moz-cite-prefix">Hi<br>
<br>
You've also missed the<br>
<br>
Note the <span class="bold"><strong>@generated not</strong></span>
that indicates that the class interface is manually defined. Do
not use <span class="bold"><strong>@generated NOT</strong></span>
since that indicates that the whole class is manually defined.<br>
<br>
comment in the (current) documentation.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>


I couldn't find this. The documentation I've read (http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotProgrammersGuide.html&anchor=OCLinEcoreEObjectValidator) only talks about adding @extends.

I've tried to google this text and couldn't find the mentioned (current) documentation.

Thank you again.
Re: Custom validation failure messages [message #1059849 is a reply to message #1059844] Tue, 21 May 2013 22:24 Go to previous messageGo to next message
Reinaldo Junior is currently offline Reinaldo JuniorFriend
Messages: 36
Registered: March 2011
Member

This is what I've tried:

1) Change the package name and URI for both the Ecore and Xtext projects.
2) Run the Ecore project as an "Eclipse Application" to start a nested eclipse (that is what I've understood from "using OCLinEcoreEObjectValidator at run-time")
3) From inside this first Eclipse-inception, create the Xtext project.
4) Imported my Ecore in the Xtext using the URI (and not the "platform:/resource/..." path) and
5) Change the JRE of every Xtext project (was J2SE-1.5) to the same JRE used on the Ecore projects (JavaSE-1.7)
That is what I've understood from "[fixing] JRE consistency". Rebuild
6) Run the Xtext project as an "Eclipse Application" (second Eclipse-inception)
7) Created a new project to test my DSL.

AND IT WORKED.

I had tried all the steps except (5) and it didn't work. It's really tricky...

One last question: is all this Eclipse-inception really required? I mean, It's not comfortable to have 3 eclipses running to be able to test something DSL.

Thank you.
Re: Custom validation failure messages [message #1059894 is a reply to message #1059830] Wed, 22 May 2013 06:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi

I don't understand how you are using your code so I don't understand why
you need three Eclipses. I endeavour to make dynamic EMF work so that
you can often use just one for modeling. But if your tooling generates
Java you need one for the producer and one for the consumer.

The U in URI is for Unique, If you have duplicates, all bets are off.
The namespace reservation of java.* for Java, org.eclipse.* for Eclipse
etc is to make duplicates easy to avoid.

Regards

Ed Willink


On 21/05/2013 20:01, Reinaldo Junior wrote:
> Ed Willink wrote on Tue, 21 May 2013 15:01
>> Hi
>>
>> You need to use the OCLinEcoreEObjectValidator , which you are
>> source-wise, but you also need to use it at run-time, so you must run
>> in a nested Eclipse.
>
>
> Thank you Ed,
>
> Does it mean I have to build my Xtext project from a nested Eclipse
> (started from running my Ecore project as an Eclipse application)? Why
> isn't enough to add the plugins which provides
> OCLinEcoreEObjectValidator as a dependency? Do you have any additional
> reference on that?
>
> Quote:
>> That fixed it still doesn't work. Changing the nsURI and rebuilding
>> fixes it.
>>
>> Using the same URI for your example as for the original tutorial is
>> very very foolish (and 'illegal'; org.eclipse... is reserved for
>> Eclipse Foundation usage).
>
>
> I would never imagine this could make any harm.
Re: Custom validation failure messages [message #1059895 is a reply to message #1059844] Wed, 22 May 2013 06:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi

Looks like a bug fix in the Kepler documentation.

Regards

Ed Willink

On 21/05/2013 21:55, Reinaldo Junior wrote:
> Ed Willink wrote on Tue, 21 May 2013 15:05
>> <html>
>> <div class="moz-cite-prefix">Hi<br>
>> <br>
>> You've also missed the<br>
>> <br>
>> Note the <span class="bold"><strong>@generated not</strong></span>
>> that indicates that the class interface is manually defined. Do
>> not use <span class="bold"><strong>@generated NOT</strong></span>
>> since that indicates that the whole class is manually defined.<br>
>> <br>
>> comment in the (current) documentation.<br>
>> <br>
>> Regards<br>
>> <br>
>> Ed Willink<br>
>
>
> I couldn't find this. The documentation I've read
> (http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotProgrammersGuide.html&anchor=OCLinEcoreEObjectValidator)
> only talks about adding @extends.
>
> I've tried to google this text and couldn't find the mentioned
> (current) documentation.
>
> Thank you again.
Re: Custom validation failure messages [message #1059898 is a reply to message #1059849] Wed, 22 May 2013 06:58 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4153
Registered: July 2009
Senior Member
Hi

JRE version matching is a regular nightmare.

Java is generous in not requiring everyone to rebuild everything for
each new version, but there are limitation to its generosity. In
particular a 1.5 class may not invoke a 1.6 class. If you are running
Eclipse with a 1.7 JRE, this may show up when you invoke a standalone
application/nested Eclipse with a configured JRE.

Most Eclipse code is built with 1.5 class compatibility, so you are ok
if you set your compatibility to 1.5 too.
- in the Window Preferences = 1.5
- in genmodel >= 1.5 (important pre-Juno when default could be 1.4)
- in the Manifest JRE requirement (and update classpath after any change)

However some 1.6 features are hard to resist and so some plugins need 1.6.

1.5 is increasingly old and some non-Eclipse libraries such as Google
Guava have moved to 1.6. I'm seriously considering raising the lower
bound for at least the newer OCL code to 1.6 after Kepler.

Regards

Ed Willink


On 21/05/2013 23:24, Reinaldo Junior wrote:
> This is what I've tried:
>
> 1) Change the package name and URI for both the Ecore and Xtext projects.
> 2) Run the Ecore project as an "Eclipse Application" to start a nested
> eclipse (that is what I've understood from "using
> OCLinEcoreEObjectValidator at run-time")
> 3) From inside this first Eclipse-inception, create the Xtext project.
> 4) Imported my Ecore in the Xtext using the URI (and not the
> "platform:/resource/..." path) and 5) Change the JRE of every Xtext
> project (was J2SE-1.5) to the same JRE used on the Ecore projects
> (JavaSE-1.7)
> That is what I've understood from "[fixing] JRE consistency". Rebuild
> 6) Run the Xtext project as an "Eclipse Application" (second
> Eclipse-inception)
> 7) Created a new project to test my DSL.
>
> AND IT WORKED.
>
> I had tried all the steps except (5) and it didn't work. It's really
> tricky...
>
> One last question: is all this Eclipse-inception really required? I
> mean, It's not comfortable to have 3 eclipses running to be able to
> test something DSL.
>
> Thank you.
Previous Topic:How to specify integer value in an invariant?
Next Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) RC1 is now available.
Goto Forum:
  


Current Time: Mon Nov 24 21:42:27 GMT 2014

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

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