[rules-users] Problem loading DRL from DSL?

Edson Tirelli tirelli at post.com
Fri Sep 14 11:26:02 EDT 2007


    Rod,

    May I ask you please to use latest build from here?

 http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules

    I fixed the error messages a few days ago and the fix will be relased in
4.0.2. This way, when running your example, we will see what the problem is
and solve it accordingly.

    Thanks,
       Edson



2007/9/14, kissro at lidp.com <kissro at lidp.com>:
>
> Is there a bug with drools when you try to use a dsl and drl?  I've read
> several post where people seem to be getting the same errors as I am.
> My drl looks like this:
>
> package com.insurance
> expander underwriting.dsl
>
> rule "Low Premium"
>    when
>        There is a policy
>         - for a male
>         - with a premium less than 50.00
>    then
>         Accept the policy;
> end
>
> I have this code to read the drl and associated dsl and build a package:
>
>   String drl = "/underwriting.drl";
>   String dsl = "/underwriting.dsl";
>   PackageBuilder builder = new PackageBuilder();
>
>   InputStreamReader drlInput = new
>        InputStreamReader(InsuranceExample.class.getResourceAsStream(drl));
>   InputStreamReader dslInput = new
>        InputStreamReader(InsuranceExample.class.getResourceAsStream(dsl));
>
>   builder.addPackageFromDrl(drlInput, dslInput);
>
>   RuleBase ruleBase = RuleBaseFactory.newRuleBase();
>   ruleBase.addPackage( builder.getPackage() );
>
> When I run the code I get a 'ExpanderException'
>
> Exception in thread "main" org.drools.rule.InvalidRulePackage:
>                            org.drools.lang.ExpanderException at 157aa53
>                            org.drools.lang.ExpanderException at 6f50a8
>                            org.drools.lang.ExpanderException at 187814
>                            org.drools.lang.ExpanderException at 73a7ab
>                            org.drools.lang.ExpanderException at 104faf8
>                            org.drools.lang.ExpanderException at 1f8c6df
>                            org.drools.lang.ExpanderException at 1c86be5
>                            org.drools.lang.ExpanderException at 123b25c
>                            org.drools.lang.ExpanderException at 92bbba
>                            org.drools.lang.ExpanderException at 162dbb6
>                            org.drools.lang.ExpanderException at 146c1d4
>                            org.drools.lang.ExpanderException at 5f8172
>                            org.drools.lang.ExpanderException at 2ba11b
>                            org.drools.lang.ExpanderException at 5e179a
>                            org.drools.lang.ExpanderException at 15fadcf
>         at org.drools.rule.Package.checkValidity(Package.java:408)
>         at org.drools.common.AbstractRuleBase.addPackage
>                             (AbstractRuleBase.java:288)
>
> Can someone tell me what I'm doing wrong and what the correct code would
> be for reading a drl/dsl and building a package and rulebase?  Does
> building drl rules from a dsl not work in drools 4.0.1?
>
> Thanks,
> Rod
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070914/c07d9c55/attachment.html 


More information about the rules-users mailing list