Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Reverse sort for sortedBy()
Reverse sort for sortedBy() [message #939654] Wed, 10 October 2012 20:14 Go to previous message
Warwick Burrows is currently offline Warwick Burrows
Messages: 84
Registered: July 2009
Location: Austin, TX
Member
Hi,

Is there a way to perform a reverse sort in an OCL query? Looking on the web the only place I found a reference to reverse OCL sorting indicated that putting a "-" in front of the sort field would work e.g. sortedBy(e|-e.name). But I get an exception:

Caused by: org.eclipse.ocl.SemanticException: Cannot find operation (-()) for the type (String)

I also tried sortedBy(-e|e.name) but got this error instead:

Caused by: org.eclipse.ocl.SyntaxException: 2:374:2:374 "::" expected instead of "|"

Is that the correct syntax? Is there another way to reverse sort?

Thanks,
Warwick

[Updated on: Wed, 10 October 2012 20:21]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:OCL to Java
Next Topic:Validate OCL constraints on XMI model
Goto Forum:
  


Current Time: Sun May 19 13:07:23 EDT 2013

Powered by FUDForum. Page generated in 0.01595 seconds