Le 15/03/2011 22:53, jwest a écrit :
However, I don't know how to make this first line more complex
using
the guided editor.
For example, you can hover on the second line of the rule and click on
it and the shown dialog pop ups, allowing me to make this line more
complex through adding restrictions on a field, new formula, etc. I
can't get a similar dialog for the first line of the rule.
No you can't
... A DSL sentence stands for a whole condition (or
action). You can't really "add" contraints in it. One thing that could
work is to define DSL phrase starting with "-" (see documentation) and
add them just under the main DSL sentence. But careful using that, as
DSL phrase are not filtered according to their context, your DSL may
become complex and a bad usage (which becomes more and more frequent as
the DSL grows) will produce rules that does not compile, or worse, that
does silly things ...
I think I should be able, otherwise how could I write an 'OR'
condition between this 2 lines?
You must first create a "OR" condition
(something like "one of the
following is true :"), which will create a container for sub-conditions.
You can then insert the condition inside this "OR" container.
Also, enums are displayed as a simple selection list (combo box) in
the DSL sentence. Is it possible to have multi-selection, effectively
getting a list of selected values to be used inside the rule?
I don't think so
To gain flexibility on rules coding, you should consider not using DSL,
or use it when you are really forced to (it is my opinion, as discussed
in this thread :
http://drools-java-rules-engine.46999.n3.nabble.com/Who-writes-your-rules...)