Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Handle EMF Float attributes with aql(error message cannot cast float to double)
Handle EMF Float attributes with aql [message #1758269] Sun, 26 March 2017 11:26 Go to next message
Michel Schaffers is currently offline Michel SchaffersFriend
Messages: 4
Registered: February 2016
Junior Member
Hello

I use latest of EMF and Sirius.

I want to make a precondition on my emf model.

Recommended way is to use aql.

I do not succeed in writing a precondition on a emf EFloat attribute.

This is my precondition:
aql:self.Cost > 0.0 where Cost is an emf EFloat attribute.

I get the following error message on the console:

!ENTRY org.eclipse.sirius 2 0 2017-03-26 12:37:05.759
!MESSAGE the following abstract node mapping precondition could not be correctly evaluated : aql:self.Cost>0.0
!STACK 0
org.eclipse.sirius.common.tools.api.interpreter.EvaluationException: greaterThan(java.lang.Comparable,java.lang.Comparable) with arguments [5.0, 0.0] failed:
java.lang.Double cannot be cast to java.lang.Float
at org.eclipse.sirius.common.acceleo.aql.business.internal.AQLSiriusInterpreter.evaluate(AQLSiriusInterpreter.java:192)
at org.eclipse.sirius.common.tools.internal.interpreter.AbstractInterpreter.evaluateBoolean(AbstractInterpreter.java:72)
at org.eclipse.sirius.tools.internal.interpreter.ODesignGenericInterpreter.evaluateBoolean(ODesignGenericInterpreter.java:156)
at org.eclipse.sirius.diagram.business.api.query.AbstractNodeMappingQuery.evaluatePrecondition(AbstractNodeMappingQuery.java:79)

The same condition on a EDouble attribute works OK.

The same condition in the model request interpreter (with target inserted at the right place) gives the same error 'greaterThan(java.lang.Comparable,java.lang.Comparable) with arguments [5.0, 0.0] failed: java.lang.Double cannot be cast to java.lang.Float'

How can I handle emf EFloat attributes with aql?

Presently, the only workaround I found was to convert the EFloat attribute into an EDouble, which is rather rude!

Many thank in advance.

Michel Schaffers


Re: Handle EMF Float attributes with aql [message #1758289 is a reply to message #1758269] Mon, 27 March 2017 08:23 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
Hi.

This looks like https://bugs.eclipse.org/bugs/show_bug.cgi?id=506213, which was fixed in AQL, but currently only available in milestone releases. The fix will be included in the next release for Oxygen (in June).

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Pre-Conditions between viewpoints
Next Topic: Could not create the view: org.eclipse.team.
Goto Forum:
  


Current Time: Mon Sep 23 02:05:01 GMT 2024

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

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

Back to the top