Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » What is wrong in this expression with enumeration values?
What is wrong in this expression with enumeration values? [message #683379] Mon, 13 June 2011 12:19 Go to next message
Aintzane  is currently offline Aintzane
Messages: 10
Registered: March 2011
Junior Member
Hi,

I am newbie in OCL. I am working with GMF, and Ecore models, and I am trying to add an Audit Rule with an OCL constraint. This is my constraint:
connector->forAll(r1 | r1.toInPort.logicType = #NO_WAIT implies r1.fromOutPort.logicType = #AND)'

I am getting the follwing error:
Cause: 2:46 "#" unexpected character ignored

logicType attributes are enumerations, what is wrong?

Thank you in advance, regards

Aintzane
(no subject) [message #683405 is a reply to message #683379] Mon, 13 June 2011 12:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3840
Registered: July 2009
Senior Member
Hi

Although # was used in some UML 1.x examples, # was never part of OCL.

You should qualify your enumeration literal with its enumeration e.g.
LogicType::AND.

Where did you find an example suggesting #AND?

Regards

Ed Willink

On 13/06/2011 17:19, Aintzane wrote:
> Hi,
>
> I am newbie in OCL. I am working with GMF, and Ecore models, and I am
> trying to add an Audit Rule with an OCL constraint. This is my
> constraint:
> connector->forAll(r1 | r1.toInPort.logicType = #NO_WAIT implies
> r1.fromOutPort.logicType = #AND)'
>
> I am getting the follwing error:
> Cause: 2:46 "#" unexpected character ignored
>
> logicType attributes are enumerations, what is wrong?
>
> Thank you in advance, regards
>
> Aintzane
>
Re: (no subject) [message #683743 is a reply to message #683405] Tue, 14 June 2011 06:49 Go to previous messageGo to next message
Aintzane  is currently offline Aintzane
Messages: 10
Registered: March 2011
Junior Member
Hi,

Thank you very much, Edward. Your help has been very useful.

I donwloaded a document called "Object Constraint Language
Specification", but perhaps it is a bit old, from March 2000, I've attached it.

Best regards,

Aintzane
Re: (no subject) [message #683922 is a reply to message #683743] Tue, 14 June 2011 12:16 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3840
Registered: July 2009
Senior Member
Hi

That is a UML 1.3 chapter, so correspomdingly OCL 1.3. Seriously out of
date. Burn it.

The latest specification is at http://www.omg.org/spec/OCL/

Thanks fior the reference,
http://wiki.eclipse.org/MDT/OCL/FAQ#How_do_I_solve:_.22.23.22_unexpected_character_ignored
updated.

Regards

Ed Willink

On 14/06/2011 11:49, Aintzane wrote:
> Hi,
>
> Thank you very much, Edward. Your help has been very useful.
>
> I donwloaded a document called "Object Constraint Language
> Specification", but perhaps it is a bit old, from March 2000, I've attached it.
>
> Best regards,
>
> Aintzane
Previous Topic:[Announce] Eclipse OCL 3.1.0 RC4 is now available
Next Topic:Unregistering an EValidator
Goto Forum:
  


Current Time: Wed Apr 16 18:48:20 EDT 2014

Powered by FUDForum. Page generated in 0.02416 seconds