Yes, you can program a loop in the GPD.
Depending on the complexity of your loop, you may need to add some more logic through a programatic way.
I think you need to include an end state, but you can specify a way in wich the transaction to that state is never taken.
Tks for your reply. I don't quite understand this yet:
"I think you need to include an end state, but you can specify a way in wich the transaction to that state is never taken."
I posted this question to make sure this is not yet implemented in jbpm before I start coding it in my own way.
Many thanks again.
To put it in a programatic way:
Let's say you have a 4 state cenario:
1 - Start State
2 - State A
3 - State B
4 - End State
The following transitions exist:
1 to 2
2 to 3
*2 to 4
3 to 2
The "2 to 4" transition should never been taken, therefore making a 2-3-2 loop for ever.
You could force this through an ActionHandler (check docs if you don't know what it is).
by forcing the "2 to 3" transition
context.leaveNode("2 to 3");
You could also hard code your transistions in the JPDL (xml source of the process) by placing conditions on the transactions (again see docs for this).