<!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">
    Hi,<br>
    <br>
    First of all, you can create 2 packages in Guvnor and then use the 2
    different URL according to what KB (ie package) you want to launch,
    exactly the same way you did before with DRL files. I don't think
    this is a bad practice in the case of two distinct use-cases, except
    if the two DRL are sharing some rules. And it will be far much
    simpler according to where you are at now ...<br>
    <br>
    If you want to use a single KB (because you are sharing rules, or
    expect to, or only to learn RuleFlows), you have to limit the rules
    that can fire according to your A or B group. A RuleFlow is a way to
    do that. Briefly (the doc will explain that with more details), a
    RuleFlow is state-transition graph that is used to filter the rules
    that can fire : Only the rules having a "ruleflow-group" equals to
    the actual state in the graph can fire. When no more rules of that
    state can fire, the next state (according to the graph and
    eventually more conditions) become the current one, until the end
    reached.<br>
    <br>
    So, for your specific case, you need to :<br>
    &nbsp;&nbsp; - assign a "ruleflow-group" ("show options" in Guvnor) "A" or "B"
    to your rules (states are only Strings)<br>
    &nbsp;&nbsp; - create a RuleFlow (in eclipse) with two states "A" and "B" (not
    only the names, but the ruleflow-group attribute in "properties"
    view)<br>
    &nbsp;&nbsp; - In your RuleFlow, you need a start node and a end node, and a
    banch node to switch between A or B path according to some
    condition. This condition can be a test on a global var, or
    something in the WM, or a static method call ... whatever<br>
    &nbsp;&nbsp; - And last, when you execute your kBase, you have to call a
    kSession.startProcess ("your rule flow id") before calling
    fireAllRules().<br>
    <br>
    See Drools doc for details, samples ... but the mains steps are
    described above.<br>
    <br>
    Have fun !<br>
    <br>
    <br>
    Le 17/06/2011 12:06, Michael Anstis a &eacute;crit&nbsp;:
    <blockquote
      cite="mid:BANLkTinHeiASKnK7UXRrrvhirXbhnucqmg@mail.gmail.com"
      type="cite">ruleflow-group is a rule attribute and, AFAIK,
      something you assign in your rule-flow to relate rules to flows.<br>
      <br>
      Unfortunately I am not an expert on drools-flow so I am hoping
      somebody more experienced and confirm my thoughts.<br>
      <br>
      You do not need to use the attribute when loading the
      KnowledgeBase, just when authoring your flows.<br>
      <br>
      With kind regards,<br>
      <br>
      Mike<br>
      <br>
      <div class="gmail_quote">2011/6/17 Serge Vilvovsky <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:sergevil@gmail.com">sergevil@gmail.com</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">Thank you, Mike.<br>
          <br>
          Can you let me know, please, what is the way to differentiate
          the ruleflow-groups on Knowledge Base reading? What classes
          does it affect?<br>
          <br>
          Regards,<br>
          <font color="#888888">Serge</font>
          <div>
            <div class="h5"><br>
              &nbsp;<br>
              <div class="gmail_quote">2011/6/16 Michael Anstis <span
                  dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:michael.anstis@gmail.com"
                    target="_blank">michael.anstis@gmail.com</a>&gt;</span><br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">IIRC, you can use different
                  ruleflow-groups to differentiate the two rules.<br>
                  <br>
                  The problem you describe would be evident locally if
                  you used a single KnowledgeBase containing the two
                  rules. Creating two KBs would not normally be
                  recommended.<br>
                  <br>
                  A single KB should be sufficient.<br>
                  <br>
                  With kind regards,<br>
                  <br>
                  Mike<br>
                  <br>
                  <div class="gmail_quote">
                    <div>
                      <div>2011/6/17 Serge Vilvovsky <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:sergevil@gmail.com"
                            target="_blank">sergevil@gmail.com</a>&gt;</span><br>
                      </div>
                    </div>
                    <blockquote class="gmail_quote" style="margin: 0pt
                      0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                      204, 204); padding-left: 1ex;">
                      <div>
                        <div>I am a beginner with drools, sorry, if the
                          question is too trivial.<br>
                          <br>
                          I have two drl files A and B. Both they
                          validate the instance of the same type T, but
                          produce the different output.<br>
                          I call the drool A within one business flow
                          and drool B within another flow. <br>
                          <br>
                          Before now I ran them locally, creating two
                          separate KnowledgeBases, and everything worked
                          fine. Now I want to use the Guvnor. <br>
                          <br>
                          If I put them to the same package and run: <br>
                          <pre><a moz-do-not-send="true">http://&lt;server&gt;/guvnor-webapp/org.drools.guvnor.Guvnor/package/&lt;packageName&gt;/</a><a moz-do-not-send="true">LATEST</a></pre>
                          I will get the KnowledgeBase that contains
                          them both, I believe. According to my
                          understanding, because they process the
                          instance of the same type, I cannot use such
                          KnowledgeBase. <br>
                          <br>
                          What should I do? Is it any API that allows to
                          distinguish the KnowelageBases for the
                          different drools within the same package or I
                          need to put them to the different packages?<br>
                          <br>
                          Thank you!<br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>