Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [CompleteOCL]definition uses definition
[CompleteOCL]definition uses definition [message #632189] Tue, 12 October 2010 02:54 Go to next message
Liu Qiang is currently offline Liu QiangFriend
Messages: 2
Registered: September 2010
Junior Member
hi, all:
I am new to OCL.. I tried to reuse definitions in OCL. For example, in CompleteOCL editor:

def: criteria1(c:Integer):Boolean = c > 90 and c < 100
def: criteria2(c:Integer):Boolean = c > 80 and c < 95
def: check(r:Integer):Boolean = criteria1(r) and criteria2(r)

The editor could not resolve criteria1 and criteria2 in check. Does the OCL specification allow such reuse of defintions? Is this only a bug specific to the editor? Thanks!

Liu Qiang
Re: [CompleteOCL]definition uses definition [message #632197 is a reply to message #632189] Tue, 12 October 2010 04:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Liu

Yes, this is a known bug in the editor.

The underlying Java support should work, and indeed if you save the file
and put it through the

[The OCL specification indeed specifies that such reuse of definitions
is allowed, but unfortunately neglects to provide a mechanism for an AST
with such reuse to be persisted. A solution to the specification is
currently being prototyped within MDT/OCL and this will solve the editor
problem too.]

Regards

Ed Willink



On 12/10/2010 03:54, Liu Qiang wrote:
> hi, all:
> I am new to OCL.. I tried to reuse definitions in OCL. For example, in
> CompleteOCL editor:
> def: criteria1(c:Integer):Boolean = c > 90 and c < 100
> def: criteria2(c:Integer):Boolean = c > 80 and c < 95
> def: check(r:Integer):Boolean = criteria1(r) and criteria2(r)
>
> The editor could not resolve criteria1 and criteria2 in check. Does the
> OCL specification allow such reuse of defintions? Is this only a bug
> specific to the editor? Thanks!
>
> Liu Qiang
>
Re: [CompleteOCL]definition uses definition [message #657923 is a reply to message #632197] Fri, 04 March 2011 16:00 Go to previous messageGo to next message
Juan Cadavid is currently offline Juan CadavidFriend
Messages: 59
Registered: July 2009
Location: Paris, France
Member

Hi,

Im also interested in the workaround for this bug, but apparently the answer got cut ("put it through the...").

Thanks,

-Juan Cadavid
Re: [CompleteOCL]definition uses definition [message #657985 is a reply to message #657923] Fri, 04 March 2011 19:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Juan

Sorry. The complete answer was "put it through the LPG (rather than
Xtext) parser".

This is fixed in the new release. M6 available in about 2 weeks. The new
release also removes forward/backward resolution problems.

Regards

Ed Willink


On 04/03/2011 16:00, Juan Cadavid wrote:
> Hi,
> Im also interested in the workaround for this bug, but apparently the
> answer got cut ("put it through the...").
>
> Thanks,
>
> -Juan Cadavid
Re: [CompleteOCL]definition uses definition [message #658179 is a reply to message #657985] Mon, 07 March 2011 10:14 Go to previous message
Juan Cadavid is currently offline Juan CadavidFriend
Messages: 59
Registered: July 2009
Location: Paris, France
Member

Great news! Thank you Smile

-Juan
Previous Topic:OCL Context and UML Usage relationship
Next Topic:Bug in OCL or in my code?
Goto Forum:
  


Current Time: Fri Mar 29 02:03:38 GMT 2024

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

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

Back to the top