Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Saving a file with OCLinEcore undefines EOpposite in a referenced model
icon5.gif  Saving a file with OCLinEcore undefines EOpposite in a referenced model [message #890238] Thu, 21 June 2012 10:53 Go to next message
Hartmut Lackner is currently offline Hartmut Lackner
Messages: 2
Registered: June 2012
Junior Member
Hi all,
I just installed the OCLinEcore Editor. I find it very convenient for editing constraints on ecore models. Though, I observed an oddity, but perhaps I am using ecore the wrong way. So any adwise would be much appreciated.

Consider this small example:

Model 1
Class A
refFromAtoB: Class B (Containment = true, EOpposite = refFromBtoA)

Model 2
Class B
refFromBtoA: Class B (Containment = false, EOpposite = refFromAtoB)

When I edit Model 1 with OCLinEcore-Editor (for example adding an invariant which states 'true'), save it and re-open it with the Ecore Example Editor, the value of EOpposite of refFromBtoA in Model 2 is undefined. I would have expected it to be left unchanged.

Best regards and thanks in advance,
Hartmut Lackner
Re: Saving a file with OCLinEcore undefines EOpposite in a referenced model [message #890267 is a reply to message #890238] Thu, 21 June 2012 13:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4034
Registered: July 2009
Senior Member
Hi

When reporting OCLinEcore issues, it would help if you use OCLinEcore
syntax, so that it can just be cut and paste.

I presume you mean

package Model1 : pfx = 'http://Model1'
{
class A {
property refFromAtoB # refFromBtoA : Model2::B {composes} ;
}
}

package Model2 : pfx = 'http://Model2'
{
class B
{
property refFromBtoA # refFromAtoB : Model1::A;
}
}

with Model1 and Model2 in separate files.

Well that gives me lots of trouble. The main problem is that the edit of
the Model1 file is just that. It should be a joint edit of both models
so that the save updates both.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=383259 raised.

Stylistically, a cyclic reference between models is not a particularly
good idea. Put them in the same file.

Regards

Ed Willink



On 21/06/2012 15:53, Hartmut Lackner wrote:
> Hi all,
> I just installed the OCLinEcore Editor. I find it very convenient for
> editing constraints on ecore models. Though, I observed an oddity, but
> perhaps I am using ecore the wrong way. So any adwise would be much
> appreciated.
> Consider this small example:
>
> Model 1
> Class A
> refFromAtoB: Class B (Containment = true, EOpposite = refFromBtoA)
>
> Model 2
> Class B
> refFromBtoA: Class B (Containment = false, EOpposite = refFromAtoB)
>
> When I edit Model 1 with OCLinEcore-Editor (for example adding an
> invariant which states 'true'), save it and re-open it with the Ecore
> Example Editor, the value of EOpposite of refFromBtoA in Model 2 is
> undefined. I would have expected it to be left unchanged.
>
> Best regards and thanks in advance,
> Hartmut Lackner
Re: Saving a file with OCLinEcore undefines EOpposite in a referenced model [message #890408 is a reply to message #890267] Fri, 22 June 2012 04:50 Go to previous message
Hartmut Lackner is currently offline Hartmut Lackner
Messages: 2
Registered: June 2012
Junior Member
Yes, your assumed model is correct w.r.t to my intention. You have even fixed the typo in the property refFromBtoA by correcting it to be of type A. Great!

Sorry for not posting the OCLinEcore file. Next time I will do so.

> Stylistically, a cyclic reference between models is not a particularly
> good idea.
For sure Smile
Currently, it is convenient for us to store the model in two separate files. But I guess, we can live with a single file, too.

Thanks for your answer.

Regards
Hartmut Lackner
Previous Topic:[Announce] Eclipse OCL 4.0.0 (Juno) RC4 is now available
Next Topic:OCL expression intersection
Goto Forum:
  


Current Time: Wed Aug 27 21:16:43 EDT 2014

Powered by FUDForum. Page generated in 0.01679 seconds