Skip to main content



      Home
Home » Modeling » OCL » [CompleteOCL]definition uses definition
[CompleteOCL]definition uses definition [message #632189] Mon, 11 October 2010 22:54 Go to next message
Eclipse UserFriend
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 00:50 Go to previous messageGo to next message
Eclipse UserFriend
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 11:00 Go to previous messageGo to next message
Eclipse UserFriend
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 14:26 Go to previous messageGo to next message
Eclipse UserFriend
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 05:14 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 01:43:01 EDT 2025

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

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

Back to the top