Hello everyone.
First off I’m not to sure whether or not I should post this here. If it belongs elsewhere please let me know.
Anyways, I’ve been using simpleworkflow for my workflow needs and it’s been great but I’ve run into a little issue recently.
Here’s the problem. I would like my workflow to branch out into one of two choices. The setup for the workflow is as follows (it’s incomplete, just showing what is relevant to the problem)
array( 'id'=>'start', 'transition'=> 'stepTwo,cancel'),
array( 'id'=>'cancel','transition'=>'stepThree',
'constraint'=>'!$this->needsConfirm();'),
array( 'id'=>'stepTwo', 'transition'=> 'completed',
'constraint'=>'$this->needsConfirm();'),
The idea being that either ‘cancel’ or ‘stepTwo’ return true and the workflow proceeds onto that branch. I have however run into the problem in which swGetNextNodes() only returns an array with the first of the two “next nodes” (in this case ‘stepTwo’). So only the constraint on that Node is executed and if it returns false then it never proceeds to ‘cancel’.
Is this desired behavior? If so maybe I’m missing some of the basics. Is there a way to fork on a simple true/false.
I would also like to add that I would rather not set the constraints directly into the transitions with a ‘transition’ => array(‘stepTwo’ => ‘$this->needsConfirm()’,etc…)
Thanks in advance for your help.