Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Multiple views on the same model
Multiple views on the same model [message #638002] Tue, 09 November 2010 10:35 Go to next message
Michael Zeising is currently offline Michael Zeising
Messages: 11
Registered: March 2010
Junior Member
I have a language that is modelled in Ecore. Now I want to express invariants in EVL on an instance of this language from two different 'views':


  • upper view (U): metamodel is Ecore, e. g.:
    context Class { check: self.name.isUpperCase() }
    I'm adding an EmfModel to the EvlModule for this.
  • lower view (L): metamodel is the language model, e. g.
    context Person { check: not self.parents.includes(self) }
    so I'm adding a MyLanguageModel to the EvlModule


The problem is: when I'm using the same EvlModule, the EVL interpreter seems to switch on the models and only interprets one of the invariant collections.

I could use two different modules but then I'm not able to use operations in L that have been defined on the U-level.

I know that it's a bit confusing but do you have any suggestions?

Thanks,
Michael
Re: Multiple views on the same model [message #638010 is a reply to message #638002] Tue, 09 November 2010 10:40 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Michael,

Would it help if you put the common operations in a separate .eol file
and then imported this file from your two modules using "import"
statements?

Cheers,
Dimitris

Michael Zeising wrote:
> I have a language that is modelled in Ecore. Now I want to express
> invariants in EVL on an instance of this language from two different
> 'views':
>
>
> upper view (U): metamodel is Ecore, e. g.: context Class { check:
> self.name.isUpperCase() } I'm adding an EmfModel to the EvlModule for this.
> lower view (L): metamodel is the language model, e. g. context Person {
> check: not self.parents.includes(self) } so I'm adding a MyLanguageModel
> to the EvlModule
>
>
> The problem is: when I'm using the same EvlModule, the EVL interpreter
> seems to switch on the models and only interprets one of the invariant
> collections.
>
> I could use two different modules but then I'm not able to use
> operations in L that have been defined on the U-level.
>
> I know that it's a bit confusing but do you have any suggestions?
>
> Thanks,
> Michael
Re: Multiple views on the same model [message #638158 is a reply to message #638010] Wed, 10 November 2010 04:01 Go to previous message
Michael Zeising is currently offline Michael Zeising
Messages: 11
Registered: March 2010
Junior Member
Okay, everything is fine. I just have to join the two EVL scripts (or use 'import's as you already suggested).

The problem is that there may be only one call to parse() per EvlModule. The API is a bit misleading in that point. I think a better API would be
EvlModule module = new EvlModule(new EvlInput(inputStream));
or something.

Michael
Previous Topic:Unicode Characters in ETL Strings
Next Topic:how to access classes that extends other classes
Goto Forum:
  


Current Time: Thu Aug 21 12:18:14 EDT 2014

Powered by FUDForum. Page generated in 0.02851 seconds