title: Drools rules insert new fact and fired other rules dynamic
body: <p>I am new to drools and the kie-server. I got problem about how to insert new facts in working memory by fired rule RHS(then action) then activate other rules by these dynamic-insered facts.</p>
  
  <p>What I expect is when BaseFeature insert into Working memory from outside and activate RuleOne, inside the RuleOne "then" it will insert the new fact RuleResult, and expected to activate the RuleTwo, but it doesn't activate RuleTwo, just RuleOne was activated, is that something I doing it wrong?</p>
  
  <p>Here I have two rules and a set of facts:</p>
  
  <p>FACTS definition:</p>
  
  <pre><code>public class AppResult implements java.io.Serializable
  {
     static final long serialVersionUID = 1L;
  
     private java.lang.String key;
     private java.lang.String value;
  
     //getters and setters ...
  }
  
  
  public class BaseFeature implements java.io.Serializable
  {
  
     static final long serialVersionUID = 1L;
  
     private int age;
  
     //getters and setters ...
  }
  
  public class RuleResult implements java.io.Serializable
  {
  
     static final long serialVersionUID = 1L;
  
     private java.lang.String ruleName;
     private java.lang.Long score;
     private boolean state;
  
     //getters and setters ...
  }
  </code></pre>
  
  <p>Rule definition:</p>
  
  <pre><code>rule "RuleOne"
      dialect "mvel"
      salience 100
      no-loop true
      lock-on-active true
      when
          $b : BaseFeature( age &lt; 22 || age &gt; 40 )
      then
          RuleResult $r = new RuleResult();
          $r.setRuleName( "RuleOne" );
          $r.setState( false );
          insertLogical( $r );
  end
  
  rule "RuleTwo"
      dialect "mvel"
      no-loop false
      lock-on-active true
      salience 10
      when
          $r : RuleResult( ruleName == "RuleOne" , state == false )
          $a : AppResult( )
      then
          $a.setKey( "PASS" );
          $a.setValue( "false" );
  end
  </code></pre>
  
  <p>how to achieve fired-rules insert new fact and fired other rules dynamic?
  thank in advance!</p>
  
  <p>I am using kie-server(6.5 Final) to test, and the POST and Reponse as below:</p>
  
  <p>POST:</p>
  
  <pre><code>{
      "lookup": "RuleChainTestStateless",
      "commands": [
      {
          "insert": {
              "return-object": false,
              "object": {
                  "com.qf.rulechaintest.BaseFeature": {
                      "age": "10"
                  }
              }
          }
      },
  
      {
          "insert": {
              "return-object": true,
              "out-identifier": "AppResult",
              "object": {
                  "com.qf.rulechaintest.AppResult": {
  
                  }
              }
          }
      },
      {
          "fire-all-rules": ""
      },
      {
              "get-objects":{
                  "out-identifier":"allFactsInWrokingMemory"
              }
      }
  
      ]
  }
  </code></pre>
  
  <p>REPONSE:</p>
  
  <pre><code>{
    "type": "SUCCESS",
    "msg": "Container RuleChainTest1.1 successfully called.",
    "result": {
      "execution-results": {
        "results": [
          {
            "key": "",
            "value": 1
          },
          {
            "key": "AppResult",
            "value": {
              "com.qf.rulechaintest.AppResult": {
                "key": null,
                "value": null
              }
            }
          },
          {
            "key": "allFactsInWrokingMemory",
            "value": [
              {
                "com.qf.rulechaintest.BaseFeature": {
                  "age": 10
                }
              },
              {
                "com.qf.rulechaintest.AppResult": {
                  "key": null,
                  "value": null
                }
              },
              {
                "com.qf.rulechaintest.RuleResult": {
                  "ruleName": "RuleOne",
                  "score": null,
                  "state": false
                }
              }
            ]
          }
        ],
        "facts": [
          {
            "key": "AppResult",
            "value": {
              "org.drools.core.common.DefaultFactHandle": {
                "external-form": "0:2:1542374590:1542374590:2:DEFAULT:NON_TRAIT:com.qf.rulechaintest.AppResult"
              }
            }
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>Notice that the reponse:</p>
  
  <pre><code>"com.qf.rulechaintest.AppResult": {
                "key": null,
                "value": null
              }
  </code></pre>
  
  <p>what it expected to be:</p>
  
  <pre><code>"com.qf.rulechaintest.AppResult": {
                    "key": "PASS",
                    "value": "false"
                  }
  </code></pre>