<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 25/06/2011 08:17, Wolfgang Laun wrote:
<blockquote
cite="mid:BANLkTikm+9s=7d19bgvOX1vOCFkRJcUVKA@mail.gmail.com"
type="cite">Added BackwardChainingTest.testInsertionOrderTwo
which will <b>fail</b>, so don't be shocked if Hudson turns
purple.<br>
</blockquote>
Thanks,<br>
<br>
But please remember to rebase, or you screw up linear history in
Hudson:<br>
<br>
In short before pushing always do the following.<br>
<br>
git checkout -b b1 #creates a branch to work in<br>
... do work here<br>
git stash<br>
git pull --rebase origin master<br>
git stash pop<br>
git commit -a -m "JBRULES-X blah blah blah"<br>
git checkout master<br>
git merge b1<br>
git push<br>
<br>
That will ensure that your commits are applied linearly, which
reduces the chances of you accidentally removing other people's
work.<br>
<br>
Mark<br>
<blockquote
cite="mid:BANLkTikm+9s=7d19bgvOX1vOCFkRJcUVKA@mail.gmail.com"
type="cite"><br>
-W<br>
<br>
<br>
On 24 June 2011 22:35, Mark Proctor <<a moz-do-not-send="true"
href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>>
wrote:<br>
> On 24/06/2011 21:22, Michael Anstis wrote:<br>
><br>
> Your test, Mark, is not the same example to which Wolfgang
refers.<br>
><br>
> You'll need to re-test with the DRL at the end of Wolfgang's
email (which is<br>
> what we've included in N&N for 5.2).<br>
><br>
> It's quite possible one of the ?'s is simply wrong... but I
don't understand<br>
> the subtleties of BC syntax yet.<br>
><br>
> If the query has "?" in it, then it's pull only. In which
case the insertion<br>
> order matters, as the query is triggered when Here or in
below Person is<br>
> triggered. Inserting the Location objects after the query is
triggered will<br>
> not return a result, unless you use leave off the "?" for a
reactive "open<br>
> query"<br>
><br>
> Mark<br>
><br>
> With kind regards,<br>
><br>
> Mike<br>
><br>
> On 24 June 2011 21:14, Mark Proctor <<a
moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>>
wrote:<br>
>><br>
>> On 23/06/2011 13:20, Wolfgang Laun wrote:<br>
>><br>
>> Still not resolved...<br>
>><br>
>> I have added a test for all the possible insertion orders
for that<br>
>> particular use case and was not able to reproduce a
problem:<br>
>><br>
>> <a moz-do-not-send="true"
href="https://github.com/droolsjbpm/drools/commit/501f2196dcef754eed5a28b066b50665a5bc29a3">https://github.com/droolsjbpm/drools/commit/501f2196dcef754eed5a28b066b50665a5bc29a3</a><br>
>><br>
>> MArk<br>
>><br>
>> On 22 June 2011 21:40, Mark Proctor <<a
moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>>
wrote:<br>
>>><br>
>>> heh, I made a mistake with the rule<br>
>>> ( Location(z, y;) and ?hasFood(x, z;) )<br>
>>> should be<br>
>>> ( Location(z, y;) and hasFood(x, z;) )<br>
>>><br>
>>> Otherwise it's not reactive, and then ordering
matters.<br>
>>><br>
>>> With that change I can do the insertions in any order
and all is fine.<br>
>>><br>
>><br>
>> This works for the example you gave. But the one taken
from the<br>
>> "Introduction" still depends on the order the facts are
inserted. Below is<br>
>> the .drl, which does not need any pojos. Rule kickOff
contains the order<br>
>> that produces nothing to see and eat:<br>
>> You are in the table<br>
>> You can see []<br>
>> You can eat []<br>
>><br>
>> Insert Here after the others, and it works.<br>
>><br>
>> -W<br>
>><br>
>> import java.util.List<br>
>><br>
>> declare Thing<br>
>> thing : String @key<br>
>> end<br>
>><br>
>> declare Edible extends Thing<br>
>> end<br>
>><br>
>> declare Location extends Thing<br>
>> location : String @key<br>
>> end<br>
>><br>
>> declare Here<br>
>> place : String<br>
>> end <br>
>><br>
>> rule kickOff<br>
>> when<br>
>> then<br>
>> System.out.println( "insert Here" );<br>
>> insert( new Here( "table" ) );<br>
>> System.out.println( "insert Edible" );<br>
>> insert( new Edible( "peach" ) );<br>
>> System.out.println( "insert Location" );<br>
>> insert( new Location( "peach", "table" ) );<br>
>> end<br>
>><br>
>> # 2011-06-22<br>
>> query isContainedIn( String x, String y )<br>
>> Location(x, y;)<br>
>> or<br>
>> ( Location(z, y;) and /*?*/isContainedIn(x, z;) )<br>
>> end<br>
>><br>
>> query whereFood( String x, String y )<br>
>> ( Location(x, y;) and<br>
>> Edible(x;) )<br>
>> or<br>
>> ( Location(z, y;) and /*?*/whereFood(x, z;) )<br>
>> end<br>
>><br>
>> query look(String place, List things, List food)<br>
>> Here(place;)<br>
>> things := List() from accumulate( Location(thing,
place;),<br>
>> collectList( thing
) )<br>
>> food := List() from accumulate( /*?*/whereFood(thing,
place;),<br>
>> collectList( thing )
)<br>
>> end<br>
>><br>
>> rule reactiveLook<br>
>> when<br>
>> Here( $place : place)<br>
>> /*?*/look($place, $things; $food := food)<br>
>> then<br>
>> System.out.println( "You are in the " + $place);<br>
>> System.out.println( " You can see " + $things );<br>
>> System.out.println( " You can eat " + $food );<br>
>> end<br>
>><br>
>><br>
>> _______________________________________________<br>
>> rules-dev mailing list<br>
>> <a moz-do-not-send="true"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
>> <a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> rules-dev mailing list<br>
>> <a moz-do-not-send="true"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
>> <a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> rules-dev mailing list<br>
> <a moz-do-not-send="true"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
> <a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> rules-dev mailing list<br>
> <a moz-do-not-send="true"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
> <a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>