The misunderstanding here is that the LHS, except for code blocks like "eval", "return value expressions" and "accumulate code blocks", are all "Drools Language". When you use the "dialect" attribute in a rule or package you are telling the compiler what dialect (MVEL or Java) you will use inside these code blocks mentioned previously + the language for the RHS.

    In other words:

Map( this["type"] == "Point", $x : this["x"], size == 5 )

    Everything you see in the previous expression is "Drools language", does not matter if you set the dialect to java or mvel in the rule. It happens that Drools uses the same map syntax as MVEL (and a lot of other scripting languages). Also, we know, that drools implementation will resolve the first 2 above expressions in MVEL behind the scenes, and the 3rd will be resolved nativelly, but that is not something users should have to worry about, since they are writing it in "Drools Language".

    If they write an eval, THEN they need to differentiate between MVEL and Java according to the chosen dialect.

rule xyz
   dialect "mvel"
   eval( you write MVEL code... )
   // here you write MVEL code

rule xyz2
   dialect "java"
   eval( you write JAVA code... )
   // here you write JAVA code


2009/8/20 André Thieme <>
Edson Tirelli schrieb:
>    ooops... correct version:
> when
>    Map( this["type"] == "Point", $x : this["x"] )
>    Map( this["type"] == "Circle", this["x"] == $x )
> then
> end

Okay, so in the mvel syntax this is possible.
Can this also be achieved in the default rule syntax, without mvel?

The mvel syntax needs to be interpreted at runtime, so my Clojure lib
will have to output rules in Drools' native rule language.

What interests me most is that first part:
Map( this["type"] == "Point", $x : this["x"] )

Lisp is not dead. It’s just the URL that has changed:
rules-users mailing list

 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @