<!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 &nbsp;BackwardChainingTest.testInsertionOrderTwo
      &nbsp;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 &lt;<a moz-do-not-send="true"
        href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
      wrote:<br>
      &gt; On 24/06/2011 21:22, Michael Anstis wrote:<br>
      &gt;<br>
      &gt; Your test, Mark, is not the same example to which Wolfgang
      refers.<br>
      &gt;<br>
      &gt; You'll need to re-test with the DRL at the end of Wolfgang's
      email (which is<br>
      &gt; what we've included in N&amp;N for 5.2).<br>
      &gt;<br>
      &gt; It's quite possible one of the ?'s is simply wrong... but I
      don't understand<br>
      &gt; the subtleties of BC syntax yet.<br>
      &gt;<br>
      &gt; If the query has "?" in it, then it's pull only. In which
      case the insertion<br>
      &gt; order matters, as the query is triggered when Here or in
      below Person is<br>
      &gt; triggered. Inserting the Location objects after the query is
      triggered will<br>
      &gt; not return a result, unless you use leave off the "?" for a
      reactive "open<br>
      &gt; query"<br>
      &gt;<br>
      &gt; Mark<br>
      &gt;<br>
      &gt; With kind regards,<br>
      &gt;<br>
      &gt; Mike<br>
      &gt;<br>
      &gt; On 24 June 2011 21:14, Mark Proctor &lt;<a
        moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
      wrote:<br>
      &gt;&gt;<br>
      &gt;&gt; On 23/06/2011 13:20, Wolfgang Laun wrote:<br>
      &gt;&gt;<br>
      &gt;&gt; Still not resolved...<br>
      &gt;&gt;<br>
      &gt;&gt; I have added a test for all the possible insertion orders
      for that<br>
      &gt;&gt; particular use case and was not able to reproduce a
      problem:<br>
      &gt;&gt;<br>
      &gt;&gt; <a moz-do-not-send="true"
href="https://github.com/droolsjbpm/drools/commit/501f2196dcef754eed5a28b066b50665a5bc29a3">https://github.com/droolsjbpm/drools/commit/501f2196dcef754eed5a28b066b50665a5bc29a3</a><br>
      &gt;&gt;<br>
      &gt;&gt; MArk<br>
      &gt;&gt;<br>
      &gt;&gt; On 22 June 2011 21:40, Mark Proctor &lt;<a
        moz-do-not-send="true" href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
      wrote:<br>
      &gt;&gt;&gt;<br>
      &gt;&gt;&gt; heh, I made a mistake with the rule<br>
      &gt;&gt;&gt; ( Location(z, y;) and ?hasFood(x, z;) )<br>
      &gt;&gt;&gt; should be<br>
      &gt;&gt;&gt; ( Location(z, y;) and hasFood(x, z;) )<br>
      &gt;&gt;&gt;<br>
      &gt;&gt;&gt; Otherwise it's not reactive, and then ordering
      matters.<br>
      &gt;&gt;&gt;<br>
      &gt;&gt;&gt; With that change I can do the insertions in any order
      and all is fine.<br>
      &gt;&gt;&gt;<br>
      &gt;&gt;<br>
      &gt;&gt; This works for the example you gave. But the one taken
      from the<br>
      &gt;&gt; "Introduction" still depends on the order the facts are
      inserted. Below is<br>
      &gt;&gt; the .drl, which does not need any pojos. Rule kickOff
      contains the order<br>
      &gt;&gt; that produces nothing to see and eat:<br>
      &gt;&gt; You are in the table<br>
      &gt;&gt; &nbsp; You can see []<br>
      &gt;&gt; &nbsp; You can eat []<br>
      &gt;&gt;<br>
      &gt;&gt; Insert Here after the others, and it works.<br>
      &gt;&gt;<br>
      &gt;&gt; -W<br>
      &gt;&gt;<br>
      &gt;&gt; &nbsp;import java.util.List<br>
      &gt;&gt;<br>
      &gt;&gt; declare Thing<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; thing : String @key<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; declare Edible extends Thing<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; declare Location extends Thing<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; location : String&nbsp; @key<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; declare Here<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; place : String<br>
      &gt;&gt; end&nbsp;&nbsp;&nbsp;<br>
      &gt;&gt;<br>
      &gt;&gt; rule kickOff<br>
      &gt;&gt; when<br>
      &gt;&gt; then<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "insert Here" );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; insert( new Here( "table" ) );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "insert Edible" );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; insert( new Edible( "peach" ) );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "insert Location" );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; insert( new Location( "peach", "table" ) );<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; # 2011-06-22<br>
      &gt;&gt; query isContainedIn( String x, String y )<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; Location(x, y;)<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; or<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; ( Location(z, y;) and /*?*/isContainedIn(x, z;) )<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; query whereFood( String x, String y )<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; ( Location(x, y;) and<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; Edible(x;) )<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; or<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; ( Location(z, y;) and /*?*/whereFood(x, z;) )<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; query look(String place, List things, List food)<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; Here(place;)<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; things := List() from accumulate( Location(thing,
      place;),<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collectList( thing
      ) )<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; food := List() from accumulate( /*?*/whereFood(thing,
      place;),<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collectList( thing )
      )<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt; rule reactiveLook<br>
      &gt;&gt; when<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; Here( $place : place)<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; /*?*/look($place, $things; $food := food)<br>
      &gt;&gt; then<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "You are in the " + $place);<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "&nbsp; You can see " + $things );<br>
      &gt;&gt; &nbsp;&nbsp;&nbsp; System.out.println( "&nbsp; You can eat " + $food );<br>
      &gt;&gt; end<br>
      &gt;&gt;<br>
      &gt;&gt;<br>
      &gt;&gt; _______________________________________________<br>
      &gt;&gt; rules-dev mailing list<br>
      &gt;&gt; <a moz-do-not-send="true"
        href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
      &gt;&gt; <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>
      &gt;&gt;<br>
      &gt;&gt;<br>
      &gt;&gt; _______________________________________________<br>
      &gt;&gt; rules-dev mailing list<br>
      &gt;&gt; <a moz-do-not-send="true"
        href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
      &gt;&gt; <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>
      &gt;&gt;<br>
      &gt;<br>
      &gt;<br>
      &gt; _______________________________________________<br>
      &gt; rules-dev mailing list<br>
      &gt; <a moz-do-not-send="true"
        href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
      &gt; <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>
      &gt;<br>
      &gt;<br>
      &gt; _______________________________________________<br>
      &gt; rules-dev mailing list<br>
      &gt; <a moz-do-not-send="true"
        href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
      &gt; <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>
      &gt;<br>
      &gt;<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>