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 16:19 Go to next message
Aintzane  is currently offline Aintzane Friend
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 16:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4186
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 10:49 Go to previous messageGo to next message
Aintzane  is currently offline Aintzane Friend
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 16:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4186
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
Re: (no subject) [message #1456159 is a reply to message #683922] Thu, 30 October 2014 04:32 Go to previous messageGo to next message
Mahin Abbasipour is currently offline Mahin AbbasipourFriend
Messages: 21
Registered: June 2013
Junior Member
Hi,
Sorry for asking this simple question.
I tried to access an Enumeration literal by "EnumerationName::EnumerationLiteralName". Therefore, I have an stereotype ST1, with attribute of Attribute1 which its type is "Enumeration1". I wrote an ocl Like: self.Attribute1=Enumeration1::EnumerationLiteral1.
It gives me java.lang.UnsupportedOperationException.
I am using the nightly version of papyrus. Am I missing something here?

Thanks,
Mahin
Re: (no subject) [message #1456255 is a reply to message #1456159] Thu, 30 October 2014 06:56 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4186
Registered: July 2009
Senior Member
Hi

This is https://bugs.eclipse.org/bugs/show_bug.cgi?id=448470 for which I
have just developed an interim fix for; just struggling to make the
JUnit test work in conjunction with other plugin tests.

Regards

Ed Willink

On 30/10/2014 05:32, Mahin Abbasipour wrote:
> Hi,
> Sorry for asking this simple question.
> I tried to access an Enumeration literal by
> "EnumerationName::EnumerationLiteralName". Therefore, I have an
> stereotype ST1, with attribute of Attribute1 which its type is
> "Enumeration1". I wrote an ocl Like:
> self.Attribute1=Enumeration1::EnumerationLiteral1.
> It gives me java.lang.UnsupportedOperationException.
> I am using the nightly version of papyrus. Am I missing something here?
>
> Thanks,
> Mahin
Re: (no subject) [message #1457604 is a reply to message #1456255] Fri, 31 October 2014 13:57 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4186
Registered: July 2009
Senior Member
Hi

Should be fixed in the latest maintenance or nightly version of Eclipse OCL.

http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/5.0.3/M201410310813/mdt-ocl-Update-M201410310813.zip

http://www.eclipse.org/modeling/download.php?file=/modeling/mdt/ocl/downloads/drops/5.1.0/N201410310856/mdt-ocl-Update-N201410310856.zip

Regards

Ed Willink

On 30/10/2014 06:56, Ed Willink wrote:
> Hi
>
> This is https://bugs.eclipse.org/bugs/show_bug.cgi?id=448470 for which I
> have just developed an interim fix for; just struggling to make the
> JUnit test work in conjunction with other plugin tests.
>
> Regards
>
> Ed Willink
>
> On 30/10/2014 05:32, Mahin Abbasipour wrote:
>> Hi,
>> Sorry for asking this simple question.
>> I tried to access an Enumeration literal by
>> "EnumerationName::EnumerationLiteralName". Therefore, I have an
>> stereotype ST1, with attribute of Attribute1 which its type is
>> "Enumeration1". I wrote an ocl Like:
>> self.Attribute1=Enumeration1::EnumerationLiteral1.
>> It gives me java.lang.UnsupportedOperationException.
>> I am using the nightly version of papyrus. Am I missing something here?
>>
>> Thanks,
>> Mahin
>
Previous Topic:Enabling direct OCL-to-Java code generation in Indigo / eclipse 3.7.2
Next Topic:org.eclipse.jdt.annotation version in RCP product configurations
Goto Forum:
  


Current Time: Fri Dec 19 07:31:30 GMT 2014

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

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