title: Drools rules with boolean variable
body: <p>I want to declare a boolean variable in my drl file and wants to write a rule based on the value of that variable. I am not able to find any good example for this. </p>
  
  <p>I tried like:</p>
  
  <pre><code>declare Flag
      flag: Boolean
  end
  </code></pre>
  
  <p>In one of the rule, I am modifying like:</p>
  
  <pre><code>  flag = Boolean.TRUE;
  </code></pre>
  
  <p>and my rule is:</p>
  
  <pre><code>rule "&lt;210&gt; Determine flag"
      when
          Flag(flag == true)
      ...
  end
  </code></pre>
  
  <p>But it is giving me error as flag cannot be resolved.</p>