Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » PIVOT model and method overriding bug
PIVOT model and method overriding bug [message #911872] Wed, 12 September 2012 13:43 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

I have very simple ecore model where "general" class has a derived varible "var" of type DOUBLE and has an operation "operation" of DOUBLE.
Class "special" is extending from "general" and "operation" is also overriden.

Please open given ecore file in Sample Ecore Editor(JUNO)

Right click on "Connector" and select "Create dynamic instance" of Connector and all some children(special and general).

For "general" objects, the value for variable "var" is correct but for "special" objects value of "var" is not calculated.

import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package temp : EAAT = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
class special extends general
{
operation operation() : ecore::EDouble { ordered }
{
body: 3.5;
}
}
class general
{
operation operation() : ecore::EDouble { ordered }
{
body: 2.3;
}
attribute ID : ecore::ELongObject { ordered };
attribute name : String { ordered };
attribute var : ecore::EDoubleObject { ordered derived volatile }
{
derivation: operation();
}
property connector#general : Connector[*] { ordered };
}
class Connector
{
attribute ID : ecore::ELongObject { ordered };
attribute name : String { ordered };
property general#connector : general[*] { composes };
}
}

[Updated on: Wed, 12 September 2012 13:45]

Report message to a moderator

Re: PIVOT model and method overriding bug [message #912031 is a reply to message #911872] Wed, 12 September 2012 20:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

Thanks for the clear repro.

This has been fixed by my recent rationalization of the merged/raw
meta-models.

If you install
http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/4.1.0/N201209061453/mdt-ocl-Update-tools-N201209061453.zip
you should pick up the fix.

Regards

Ed Willink

On 12/09/2012 14:44, ModelGeek Mising name wrote:
> Hi,
>
> I have very simple ecore model where "general" class has a derived
> varible "var" of type DOUBLE and has an operation "operation" of
> DOUBLE. Class "special" is extending from "general" and "operation" is
> also overriden.
>
> Please open given ecore file in Sample Ecore Editor(JUNO)
>
> Right click on "Connector" and select "Create dynamic instance" of
> Connector and all some children(special and general).
>
> For "general" objects, the value for variable "var" is correct but for
> "special" objects value of "var" is not calculated.
>
> import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';
>
> package temp : EAAT =
> 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
> {
> class special extends general
> {
> operation operation() : ecore::EDouble { ordered }
> {
> body: 3.5;
> }
> }
> class general
> {
> operation operation() : ecore::EDouble { ordered }
> {
> body: 2.3;
> }
> attribute ID : ecore::ELongObject { ordered };
> attribute name : String { ordered };
> attribute var : ecore::EDoubleObject { ordered derived volatile }
> {
> derivation: operation();
> }
> property unnamed_3#general : Connector[*] { ordered };
> }
> class Connector
> {
> attribute ID : ecore::ELongObject { ordered };
> attribute name : String { ordered };
> property general#unnamed_3 : general[*] { composes };
> }
> }
Re: PIVOT model and method overriding bug [message #912253 is a reply to message #912031] Thu, 13 September 2012 07:48 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
thanks for quick response
Re: PIVOT model and method overriding bug [message #949993 is a reply to message #912253] Fri, 19 October 2012 14:21 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

Is this fix is also suitable for Indigo when not using pivot model?

Actually i want to use Indigo and want to have this bug fixed.

Cheers,
Re: PIVOT model and method overriding bug [message #950010 is a reply to message #949993] Fri, 19 October 2012 14:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

All Kepler builds should be useable on Indigo.

Regards

Ed Willink

On 19/10/2012 15:21, ModelGeek Mising name wrote:
> Hi,
>
> Is this fix is also suitable for Indigo when not using pivot model?
>
> Actually i want to use Indigo and want to have this bug fixed.
>
> Cheers,
Re: PIVOT model and method overriding bug [message #950036 is a reply to message #950010] Fri, 19 October 2012 15:12 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
thanks!

I have just tried this and it only works in case of Pivot model, if models delegates are not based on pivot then it does not work.

Do you have any why it is like that?

Cheers,
Re: PIVOT model and method overriding bug [message #950046 is a reply to message #950036] Fri, 19 October 2012 15:20 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

The Juno release redesignates the .../OCL delegate URI as a virtual
which can be redirected to LPG (the old Ecore implementation) or Pivot
using Window->Preferences->OCL.

Regards

Ed Willink

On 19/10/2012 16:12, ModelGeek Mising name wrote:
> thanks!
>
> I have just tried this and it only works in case of Pivot model, if
> models delegates are not based on pivot then it does not work.
>
> Do you have any why it is like that?
>
> Cheers,
Re: PIVOT model and method overriding bug [message #953432 is a reply to message #950046] Mon, 22 October 2012 08:37 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
thanks.

When i try to update my indigo with given fix then it says
"
Cannot complete the install because one or more required items could not be found.
Software being installed: OCL End User SDK 4.0.0.v20120906-1453 (org.eclipse.ocl.all.sdk.feature.group 4.0.0.v20120906-1453)"

i did it on JUNO successfully but on indigo it is problematic.

any clue?

Cheers,
Re: PIVOT model and method overriding bug [message #953629 is a reply to message #953432] Mon, 22 October 2012 11:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

You don't identify what's missing which makes diagnosis harder.

There is a problem with feature name compatibility between the Core and
Tools builds that prevents upgrading the full Tools byuild after a Core
build has been installed.

The easiest way to upgrade is uninstall all OCL artefacts then intall
OCL Examples and Editors.

Regards

Ed Willink

On 22/10/2012 09:37, ModelGeek Mising name wrote:
> thanks.
>
> When i try to update my indigo with given fix then it says "
> Cannot complete the install because one or more required items could
> not be found.
> Software being installed: OCL End User SDK 4.0.0.v20120906-1453
> (org.eclipse.ocl.all.sdk.feature.group 4.0.0.v20120906-1453)"
>
> i did it on JUNO successfully but on indigo it is problematic.
>
> any clue?
>
> Cheers,
Re: PIVOT model and method overriding bug [message #954928 is a reply to message #953629] Tue, 23 October 2012 11:11 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Installation problem is fixed.
I have now tested and verified that method overriding bug is only fixed for Pivot not for old Ecore implementation. Can you also confirm that?
In this case is there any fix available for old Ecore implementation.

I really appreciate your efforts.
thanks

Cheers,
Re: PIVOT model and method overriding bug [message #955185 is a reply to message #954928] Tue, 23 October 2012 15:31 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

The code is thought to work as intended.

Can you clearly identify a scenario that does not; preferably as a
zipped project.

Regards

Ed Willink

On 23/10/2012 13:11, ModelGeek Mising name wrote:
> Installation problem is fixed.
> I have now tested and verified that method overriding bug is only
> fixed for Pivot not for old Ecore implementation. Can you also confirm
> that?
> In this case is there any fix available for old Ecore implementation.
>
> I really appreciate your efforts.
> thanks
>
> Cheers,
Re: PIVOT model and method overriding bug [message #957658 is a reply to message #955185] Thu, 25 October 2012 11:54 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

Here comes a scenario where i have created an ecore model(the one we have discussed earlier in this thread).

I have also taken dynamic instance of one of the concept in Ecore.

"General" and "Special" has a method "Operation" and it is returning real value.

"Genrel" contains attribute "var" and it derivation statements depends on method "operation".

Please check this scenario.
Re: PIVOT model and method overriding bug [message #957762 is a reply to message #957658] Thu, 25 October 2012 13:18 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
For compatibility the Ecore-based OCL retains the legacy no
overloading functionality.<br>
<br>
You may enable overloading in the
Window-&gt;Preferences-&gt;OCL-&gt;ECore and UML<br>
<br>
<img src="http://www.eclipse.org/forums/index.php?t=getfile&amp;id=12069" alt=""><br>
<br>
(Sorry. Forgot that we had fixed the 'bug' but also preserved
compatibility. It's not a bug because the OCL specification has no
indication that dynamic overloading should be used.)<br>
<br>
&nbsp;&nbsp;&nbsp; Regards<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Ed Willink<br>
<br>
<br>
On 25/10/2012 13:54, ModelGeek Mising name wrote:
<blockquote cite="mid:k6b98v$fhk$1@xxxxxxxxe.org" type="cite">
<pre wrap="">Hi,

Here comes a scenario where i have created an ecore model(the one we have discussed earlier in this thread).

I have also taken dynamic instance of one of the concept in Ecore.

"General" and "Special" has a method "Operation" and it is returning real value.

"Genrel" contains attribute "var" and it derivation statements depends on method "operation".

Please check this scenario.
</pre>
</blockquote>
<br>
</body>
</html>
  • Attachment: abdhjhga.png
    (Size: 4.32KB, Downloaded 76 times)
Re: PIVOT model and method overriding bug [message #957788 is a reply to message #957762] Thu, 25 October 2012 13:46 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

I have tried that but it does not work


Thanks for your help!

Cheers

[Updated on: Thu, 25 October 2012 13:55]

Report message to a moderator

Re: PIVOT model and method overriding bug [message #1005968 is a reply to message #957788] Tue, 29 January 2013 12:42 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

I have tried to activate it using Window-&gt;Preferences-&gt;OCL-&gt;ECore and UML dialog and it is working fine. How can i acheive same programmatically in a standalone application?

thanks!

cheers,
Re: PIVOT model and method overriding bug [message #1005995 is a reply to message #1005968] Tue, 29 January 2013 13:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

EvaluationOptions.setOption(env, EvaluationOptions.DYNAMIC_DISPATCH, true);

Regards

Ed Willink


On 29/01/2013 12:42, ModelGeek Mising name wrote:
> Hi,
>
> I have tried to activate it using Window->Preferences->OCL->ECore and
> UML dialog and it is working fine. How can i acheive same
> programmatically in a standalone application?
>
> thanks!
>
> cheers,
Re: PIVOT model and method overriding bug [message #1006013 is a reply to message #1005995] Tue, 29 January 2013 14:45 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Thanks alot.

I am using deletgates to evaluate so is there any mechanism for delegates to achieve the same?

Cheers,
Re: PIVOT model and method overriding bug [message #1006035 is a reply to message #1006013] Tue, 29 January 2013 15:35 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

You still have to set the option on the environment.

You might need to use custom Delegate Factories to intercept the
environment creation.

Regards

Ed Willink

On 29/01/2013 14:45, ModelGeek Mising name wrote:
> Thanks alot.
>
> I am using deletgates to evaluate so is there any mechanism for
> delegates to achieve the same?
>
> Cheers,
Previous Topic:CompleteOCL parser problem
Next Topic:Saving OCL-constraint
Goto Forum:
  


Current Time: Tue Sep 23 04:21:09 GMT 2014

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

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