title: Drools rules not firing
body: <p>Drools rules in my project are not firing. I have checked official documentation and tutorials (not only official ones) and found nothing.</p>
  
  <p>This is my rule:</p>
  
  <pre><code>package iwium.rules
  
  import iwium.*;
  
  rule "One"
      when
          $var : State();
      then
          $var.setName("fired!");
          System.out.println("fired!");
  end
  </code></pre>
  
  <p>and this is how I complie rules and fire them:</p>
  
  <pre><code>public void run()
  {
      createKnowledgeBase();
  
      //I do need to use it in infinite loop
      while (true)
      {
          kSession = kBase.newStatefulKnowledgeSession();
  
          State state = new State();
          kSession.insert(state);
  
          kSession.fireAllRules();
  
          //to check if rule fired
          for (Object o: kSession.getObjects()) {
              if(o instanceof State) {
                  State rs = (State) o;
                  if(rs.getName().length() &gt; 1)
                      System.out.println("done");
              }
          }
  
          kSession.dispose();
      }
  }
  
  private void createKnowledgeBase()
  {
      this.kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      this.kBuilder.add(ResourceFactory.newClassPathResource(RULES_FILE), ResourceType.DRL);
  
      if (kBuilder.hasErrors())
      {
          System.err.println(kBuilder.getErrors().toString());
      }
  
      kBase = KnowledgeBaseFactory.newKnowledgeBase();
      kBase.addKnowledgePackages(kBuilder.getKnowledgePackages());
  }
  </code></pre>
  
  <p><strong>Output is empty.</strong> </p>
  
  <p>I have also checked in debugger that rules are compiled properly.</p>
  
  <p>Does anyone know what could be the problem here? Why this rule is not firing?</p>