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