[rules-users] Decision Table
Tihomir Surdilovic
tsurdilo at redhat.com
Mon Dec 27 10:32:50 EST 2010
To add to Wolfgangs response, you are missing
public static final int HIGHROADS = 4
in the Assignment class, also since you are updating Assignment in the
rule actions you should either put NO-LOOP on each of the rules, or you
could use a "trick" to set "lock-on-active" on a package level (see
uploaded xls). With the also uploaded test, the results I am getting are:
*****
Knowledgebase read
All rules fired
Status: 0
Message: Heavy snow and cold. Medium clearance on main roads
*****
and you can also see the generated DRL (using SpreadsheetCompiler).
Checking the generated DRL of your decision table is useful for
debugging in the future.
Hope this helps ;)
Thanks.
Tihomir
On 12/27/10 10:13 AM, Wolfgang Laun wrote:
> Hi Frank
>
> Join C8:F8 and change the contents to
> a:Assignment() and w:Weather
> all conditions deal with Weather - they'll be inserted into the last
> pair of parentheses that will be added to Weather. (The "and" is
> redundant as it is implied for patterns at the outermost level. There
> should be a single Assignment fact, and I guess there is only one
> Weather.)
>
> I would not add an update(a) to each individual action; another ACTION
> column with $param; in row nine and "update(a)" in all rows below lets
> you remove the repeated "update(a)" from H9:J9. (But this is, perhaps,
> a matter of taste.)
>
> Cheers
> Wolfgang
>
> PS: Regretfully, this set of rules is going to be late for this winter ;-)
>
>
>
> On 27 December 2010 10:23, FrankVhh <frank.vanhoenshoven at agserv.eu
> <mailto:frank.vanhoenshoven at agserv.eu>> wrote:
>
>
> Hi all,
>
> I am a brand new user of the Drools-tools and am not quite
> comfortable with
> the tools yet. The current problem I am having, is caused by an
> "Unknown
> parsing error" in a decision table.
>
> >From past experience, I guess I have made a syntax error
> somewhere in the
> file. However, I am not able to detect the error myself. Probably
> it is a
> quite simple mistake, caused by a combination of inexperience and
> neglectance :-).
>
> I figured I could use an extra pair of eyes and was hoping that some
> friendly community member could help me out on this.
>
> I will annex the table as well as the java code that contains the java
> classes (the table isn't callad from the code yet).
> http://drools-java-rules-engine.46999.n3.nabble.com/file/n2150980/strooidiensten.java
> strooidiensten.java
> http://drools-java-rules-engine.46999.n3.nabble.com/file/n2150980/clearance.xls
> clearance.xls
>
> Thank you very much in advance!
>
> Kind regards,
>
> Frank
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Decision-Table-tp2150980p2150980.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101227/b069f978/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clearance.xls
Type: application/vnd.ms-excel
Size: 16384 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20101227/b069f978/attachment.xls
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ClearanceTest.java
Url: http://lists.jboss.org/pipermail/rules-users/attachments/20101227/b069f978/attachment.pl
More information about the rules-users
mailing list