Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL: summarizing amounts in collections yields wrong result(EVL: calculating a sum over amount values in a XML instance causes EVL check to fail)
EVL: summarizing amounts in collections yields wrong result [message #1404743] Tue, 05 August 2014 12:39 Go to next message
Gerd Wierse is currently offline Gerd WierseFriend
Messages: 14
Registered: July 2009
Junior Member
Dear all,

I am using EVL to check constraints on XML instances.
Although such an instance meets a specific constraint summarizing amounts, the check fails.
May be, number representation or calculation method sum() used by EVL causes this check to fail?

I presume, the following conditions are helpful to reproduce this behavior:

  • summarizing amounts (like amounts of money) while casting such amounts to data type Real.
  • these amounts are contained in elements with multiplicity > 1, so these elements are mapped to collections.
  • this error does not show when it's only a very small number of collections.


Please find attached a simple project, containing these folders:

  • model with XSD, ecore and genmodel
  • instances with a single XML instance
  • rules with the EVL file containing a single rule and an ANT script launch.xml to build and execute instance loading and rule application


Supposedly, this is not a topic dedicated to EVL, but a more general question?
Do you know any helpful links or forum topics?
May be, I should use casting to another data type in EVL as workaround?

Thanks in advance for any helpful remark.

Best regards,
Gerd
  • Attachment: MyXSD.zip
    (Size: 4.95KB, Downloaded 116 times)
Re: EVL: summarizing amounts in collections yields wrong result [message #1404790 is a reply to message #1404743] Tue, 05 August 2014 18:58 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Gerd,

Comparing floating-point numbers for equality can be problematic in most programming languages. Please see [1] for a detailed discussion. Arguably, EOL could sort this out internally, so please file an ehnahncment request [2] and we'll fix this in a future release.

Cheers,
Dimitris

[1] http://floating-point-gui.de/errors/comparison/
[2] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=epsilon
Previous Topic:Content assist based on ecore metamodel
Next Topic:Can't delete nodes in compartment
Goto Forum:
  


Current Time: Fri Apr 26 04:00:05 GMT 2024

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

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

Back to the top