title: "if then else "with rule engines
body: <p>I'm new to drools and given a condition (Condition) and a boolean variable "a" ,  I would like to create the following rule with drools : </p>
  
  <pre><code>if (Condition)
     { 
      a = true;
     }
  else
     {
      a = false;
     }
  </code></pre>
  
  <p>What is the best way to do it ?</p>
  
  <p>For the time being I have 2 options : </p>
  
  <p><strong>1.Create 2 rules with Condition and not contidition (If ... then ... , If not ... then ...)</strong></p>
  
  <pre><code>rule "test"
  where
    $o: Object( Condition)
  then 
    $o.a = true;
  end
  
  
  rule "test2"
  where
    $o: Object( not Condition)
  then 
    $o.a = false
  end
  </code></pre>
  
  <p><strong>2.Set the variable a to false by default and then fire the rule</strong></p>
  
  <pre><code>rule "test"
  no loop
  salience 100
  where 
    $o: Object()
  then 
    $o.a = false;
  end
  
  
  rule "test"
  where
    $o: Object( not Condition)
  then 
    $o.a = true;
  end
  </code></pre>