|
Re: about the using of OCLinEcore [message #855215 is a reply to message #855201] |
Tue, 24 April 2012 16:04 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
There is no OCLinEcore file in the Royal and Loyal example.
There is a RoyalAndLoyal.ecore which is an Ecore file that may be edited
with any Ecore editor, of which OCLinEcore is just one. This file is a
pure structural meta-model; it has no embedded OCL constraints. It does
however have some very old obsolete annotations that represent one of
the earlier approaches at embedding OCL. This was superseded by the EMF
delegate technology. Thus
class CustomerCard
{
operation getTransactions(until : Date[?] { ordered }, from :
Date[?] { ordered }) : Transaction[*]
{
annotation _'http://www.eclipse.org/OCL/1.0.0/body'
(
body =
'self.transactions->select( i_Transaction : Transaction
| i_Transaction.date.isAfter(from) and i_Transaction.date.isBefore(until) )'
);
}
is an EAnnotation that looks confusingly like OCL, whereas
class CustomerCard
{
operation getTransactions(until : Date[?] { ordered }, from :
Date[?] { ordered }) : Transaction[*]
{
body:
self.transactions->select( i_Transaction : Transaction
| i_Transaction.date.isAfter(from) and i_Transaction.date.isBefore(until) );
}
would be the syntax sugar for the EAnnotation that EMF supports. I guess
this confusing content should be removed; I never noticed that it was
there when I imported the example from the OCL Tools prototype.
There is also a RoyalAndLoyal.ocl that contains the complementary
Complete OCL constraints. Prior to Juno M6, this could only be used from
Java code. There is now a Load Complete OCL Resource menu action that
would allow you to open a RoyalAndLoyal model, load the additional
constraints and see them at work using the Validate menu action, the
Sample Reflective Ecore Editor Properties View or the OCL Console.
Regards
Ed Willink
On 24/04/2012 16:49, Lucy Chan wrote:
> when loading the Royal and Loyal, I found a OCLinEcore file. In this
> file, there were many OCL expressions. And I wonder how this file make
> constraints to the .ecore file? If we need to run the OCLinEcore file?
> Or the model will be validated accordting to the definition in the
> OCLinEcore?
|
|
|
|
|
|
|
|
Re: about the using of OCLinEcore [message #857305 is a reply to message #857254] |
Thu, 26 April 2012 12:36 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
I only have 32 bit Windows machine so I only use win32.
I presume that you should use whichever is appropriate to your machine;
so I would expect onle of the two to fail miseravly just as you observe.
When reporting problems that are not clear you must be more accurate;
you may know what "Indigo Modeling tools for win32 and win64" mean. I
don't I would need exact download file specifications.
You report "I tried to installed the modeling tools using the
"Installing new software" menu, Eclipse showed an error information "An
internal error occurred Comparison method violates its general
contract", just a few words, which puzzled me."
In order to help, I need to know what menu actions you think were
appropriate and details of the error that you observe.
Regards
Ed Willink
On 26/04/2012 12:48, Lucy Chan wrote:
> Since you suggest me the Xtext OCL Console was introduced in Indigo. I downloaded the Indigo Modeling tools for win32 and win64. But for win32, when I tried to installed the modeling tools using the "Installing new software" menu, Eclipse showed an error information "An internal error occurred Comparison method violates its general contract", just a few words, which puzzled me. And I also tried the win64 and this time I even cannot restart the eclipse. The attachment is the screenshot for the error in the win64 edition.
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03877 seconds