views:

40

answers:

2

Hello. I am building a tool which should do a diagnosis based on some values... It should be user extensible so hardcoding the conditions isnt a solution...

Suppose that we have a blood test...

example ... WBC , ALDO ... And i want the user to be able to write somehow scripts

if (WBC.between(4,10) && ALDO.greater(5) || SOMETHINGELESE.isTrue()) ..... diagnosis="MPLAMPLA"...

The problem is 1)Write my parser 2)Or try to find something that executes user conditionals at runtime and customize it.. 3)another way

Please help,ideas needed!

+3  A: 
  1. Use scripting (you can use javascript, bsh, groovy, etc). See tutorial here
  2. Use workflow engine, e.g. jBPM
uthark
Scripting engine is probably the way to go, and certainly the way I'd expose this sort of functionality. This link from my code blog might come in handy also: http://szyzygycode.wordpress.com/2010/03/04/jruby-using-scriptengine-invoking-methods-passing-args/
Szyzygy
A: 

Thank you man!!! There are so many things to learn!...

Parhs