title: jBPM How to implement Decision
body: <p>I´m new on JBPM (version 3) and i´m trying to implement (unsuccessfully) a Decision.</p>
  
  <p>I realized that i must do something like this:</p>
  
  <p>Cenario 1: </p>
  
  <pre><code>&lt;decision name="XPTO Decision" expression="#{contextInstance.variables['XPTO Decision']}"&gt;
   &lt;transition name="To ActionA" to="ActionA"/&gt;
   &lt;transition name="To ActionB" to="ActionB"/&gt;
   &lt;transition to="ActionA"/&gt;
   &lt;/decision&gt;
  </code></pre>
  
  <p>Or:</p>
  
  <p>Cenario 2:  </p>
  
  <pre><code> &lt;decision name="XPTO Decision" &gt;
   &lt;transition name="To ActionA" to="ActionA"/&gt;
   &lt;transition name="To ActionA" to="ActionA"/&gt;
   &lt;transition to="ActionA"&gt;
   &lt;condition expression="#contextInstance.variables['XPTO Decision'] ge 5"/&gt;
   &lt;/transition&gt;
   &lt;/decision&gt;
  </code></pre>
  
  <p>Or:</p>
  
  <p>Cenario 3: </p>
  
  <pre><code> &lt;decision name="XPTO Decision" &gt;
   &lt;handler class="bla.bli.MyDecisionHandler"/&gt;
   &lt;transition name="To ActionA" to="ActionA"/&gt;
   &lt;transition name="To ActionB" to="ActionB"/&gt;
   &lt;transition to="ActionA"/&gt;
   &lt;/decision&gt;
  </code></pre>
  
  <p>I have done something like this, but my decision already goes to the same action (ActionB).</p>
  
  <p>I don´t have sure about how this decision work. Looking for cenario 2 i believe that is something like</p>
  
  <p>"if  variable XPTO Decision ge (greates or equals(?)) 5 then Action A
    else Action B"." Is that right?</p>
  
  <p>And...  How the cenario 3 works??? How can the handler decide which Action is correct?</p>
  
  <p>Thanks.</p>