Skip to main content



      Home
Home » Modeling » Epsilon » @lazy in EVL
@lazy in EVL [message #1634637] Wed, 25 February 2015 06:16 Go to next message
Eclipse UserFriend
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 06:43 Go to previous messageGo to next message
Eclipse UserFriend
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 09:10 Go to previous messageGo to next message
Eclipse UserFriend
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 09:27] by Moderator

Re: @lazy in EVL [message #1636699 is a reply to message #1634900] Thu, 26 February 2015 05:24 Go to previous messageGo to next message
Eclipse UserFriend
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 17:17 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 26 February 2015 23:47 Go to previous messageGo to next message
Eclipse UserFriend
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 05:22 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 09:46:54 EDT 2025

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

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

Back to the top