• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Boolean Expression Evaluation Framework

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are looking for an expression evaluation framework where we can provide input as boolean conditions like this

(MyData1 = 'A') AND (MyData2 = 'B' OR MyData2 = 'C' OR MyData2 = 'D')


I would be getting a String expression and would provide the data to that expression to find what will be the result.

Any suggestions of pointers would be appreciated.
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't recall if it supports exactly this syntax, but check out the JEP library. Version 2.4 was released under the GPL, so you may be able to use it for free.
 
Ranch Hand
Posts: 83
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JEP is a good Java library, and its 2.4.1 version was GPL.

The Boolean expressions are supported but it does not give direct boolean result.

The results of a boolean expression would be returned to you as a Double object where 1.0 = TRUE and 0.0 is FALSE.


The Boolean Expression Evaluation Example code can be used as a Utility in your application for Boolean expression evaluation.
[ September 22, 2008: Message edited by: Sachin Joshi ]
 
Priyanka Dandekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf and Sachin, thanks a lot for your responses. This is definitely useful for me.

Sachin I am using your util class for implementation, it looks handy.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
If i can understand you correctly Your system always get the expression at the Run time and the values to be replaced in the expression also comes in run time. Recently i was also in search of looking for a similar framework approach. I found cayenne framework..you can use it very easily.Reply me back if you have any queries.
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohan,
can you provide a link to this "cayenne" framework? The only Java project with that name I can find is an ORM tool, and I don't think that would be applicable here.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check http://code.google.com/p/xpressionengine/. It may cater the requirements.
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!