[rules-users] DSL: Problem of having 2 DSL statements that ends differently

Olivier THIERRY olivier.thierry at gmail.com
Tue Dec 16 03:29:06 EST 2008


I had the same kind of problem : Drools stops on the first DSL
sentence it can map to.
If you want it to work, you have to be careful about the order you
write sentences in your DSL : write them from the most restricitive to
the less.

In your case it should be :

This is a "{node1}" in "{tree}"
This is a "{node1}"

Note Drools tools for Eclipse have nothing to change order, so you
will have to open your DSL file as a text file to do this ;)

Regards,

Olivier

2008/12/16 cmgoh <cmgoh1979 at gmail.com>:
>
> Hi,
>
> Further working with DSL (btw, we are using Drools 4.0.7), I found out that
> if there are two DSL statements such as:
>
> This is a "{node1}"
> This is a "{node1}" in "{tree}"
>
> Drools will throw some errors:
> Exception in thread "main" org.drools.rule.InvalidRulePackage: Rule
> Compilation error : [Rule name=aC, agendaGroup=MAIN, salience=0,
> no-loop=false]
>        org/doxa/rules/deployer/Rule_aC_0.java (25:1671) : in cannot be resolved
>        org/doxa/rules/deployer/Rule_aC_0.java (25:1674) : Syntax error on token
> ""tree3"", invalid AssignmentOperator
>
>        at org.drools.rule.Package.checkValidity(Package.java:424)
>        at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:394)
>        at
> org.doxa.rules.deployer.RuleRunnerWithDSL.runRules(RuleRunnerWithDSL.java:36)
>        at
> org.doxa.rules.deployer.RuleRunnerWithDSL.main(RuleRunnerWithDSL.java:118)
>
> Is this a bug? It took me almost 1 day to discover this. Hope this will
> provide other DSL users some light.
>
>
> Best regards
> Eric
>
>
> --
> View this message in context: http://www.nabble.com/DSL%3A-Problem-of-having-2-DSL-statements-that-ends-differently-tp21028958p21028958.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Seules 2 choses sont infinies : l'univers et la bêtise humaine ; et
encore pour l'univers, je ne suis pas sûr … (Einstein)




More information about the rules-users mailing list