Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » @lazy in EVL
@lazy in EVL [message #1634637] Wed, 25 February 2015 11:16 Go to next message
Leila S is currently offline Leila SFriend
Messages: 36
Registered: January 2015
Member
Hi,

How can I use a constraint that is specified as a lazy invariant? when I add @lazy above an invariant, it isn't shown in the validation console.
I want to arrange the constraints, for example I want to fix the constraint1 and after that the constraint2.
For the first attempt, i use satisfies("constraint1") in the guard of constraint2; However, when I run the evl if the check block of constraint1 is not satisfied, the constraint2 is not shown. But my purpose is to fix constraint1 and after that fix constraint2. So it may be to use @lazy for constraint2 but how I could check the lazy constraint?

Bests,
Leila
Re: @lazy in EVL [message #1634674 is a reply to message #1634637] Wed, 25 February 2015 11:43 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Leila,

Could you please prepare a minimal example [1] that we can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: @lazy in EVL [message #1634900 is a reply to message #1634674] Wed, 25 February 2015 14:10 Go to previous messageGo to next message
Leila S is currently offline Leila SFriend
Messages: 36
Registered: January 2015
Member
Hi Dimitris,

I modify the example EVL intermodelhttps://www.eclipse.org/epsilon/examples/index.php?example=org.eclipse.epsilon.examples.evl.intermodel

my Epsilon version: 1.2.0.201412082118

In the example, first it is needed to fix constraint TableExists and then fix ColumnExists.
in the oo.model, there is a class named Product and its attribute named nameOfProduct which have no equivalent table and column in the db.model.

Bests,
Leila

[Updated on: Wed, 25 February 2015 14:27]

Report message to a moderator

Re: @lazy in EVL [message #1636699 is a reply to message #1634900] Thu, 26 February 2015 10:24 Go to previous messageGo to next message
Leila S is currently offline Leila SFriend
Messages: 36
Registered: January 2015
Member
Hi Dimitris,

If the example that is attached doesn't solve by specifying "ExistsColumn" as a lazy constraint, I want to know what the application of @lazy in EVL?
Because I'm new in writing EVL, if the code for constraint ExistsColumn is not good, please let me know how it should be optimized.

Bests,
Leila
Re: @lazy in EVL [message #1637788 is a reply to message #1636699] Thu, 26 February 2015 22:17 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Leila,

The @lazy annotation only controls when/how constraints are checked; it does not affect the behaviour of their fixes. The difference between lazy and non-lazy constraints is that non-lazy constraints are evaluated on all instances of their context types while non-lazy constraints are only evaluated through calls to the satisfies(...) operation. Does this help at all?

Cheers,
Dimitris
Re: @lazy in EVL [message #1638346 is a reply to message #1637788] Fri, 27 February 2015 04:47 Go to previous messageGo to next message
Leila S is currently offline Leila SFriend
Messages: 36
Registered: January 2015
Member
Hi Dimitris,

I add @lazy annotation before constraint ColumnExists and in the fix block of the constraint TableExists, I add something like the below code:
if(OO!Attribute.all.select(a|a.owner=self).size()>0) satisfies("ColumnExists");


However, after running when I want to fix the constraint TableExists for a class which has no equivalent table and has an attribute, an error occurred:
Constraint ColumnExists not found

But this constraint is defined in my EVL file! Sad
would you please explain why this error is happend?

Bests,
Leila
Re: @lazy in EVL [message #1638849 is a reply to message #1638346] Fri, 27 February 2015 10:22 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Leila,

Replacing satisfies("ColumnExists") with self.satisfies("ColumnExists") should do the trick.

Cheers,
Dimitris
Previous Topic:Display profiling info when running outside of eclipse
Next Topic:How to check for applied stereotype from a InMemoryEmfModel
Goto Forum:
  


Current Time: Fri Mar 29 00:26:19 GMT 2024

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

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

Back to the top