#014451: $workflow->nodes does not return all nodes
Description:
after modifying a workflow $workflow->nodes sometimes fails to return all nodes. in such a case
the number should be the same.
see code fragment
when you comment out the first two echo's then the code returns the correct result.
the call to $workflow->nodes makes it fail.
No resolution found
Environment:
Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):
Steps to Reproduce:
$w = new ezcWorkflow('test');
$w->startNode->addOutNode($w->endNode);
// If you remove this statement then the workflow counting works
echo "1count workflow:".count($w)."<br/>";
echo "1count nodes:".count($w->nodes)."<br/>";
$w->startNode->removeOutNode($w->endNode);
// wait for input into the workflow variable value.
$input = new ezcWorkflowNodeInput( array( 'value' => new ezcWorkflowConditionIsInteger() ) );
$w->startNode->addOutNode( $input );
// create the exclusive choice branching node
$choice = new ezcWorkflowNodeExclusiveChoice;
$input->addOutNode( $choice );
$branch1 = new ezcWorkflowNodeInput( array( 'value' => new ezcWorkflowConditionIsAnything() ) ); // create nodes for the first branch of execution here..
$branch2 = new ezcWorkflowNodeInput( array( 'value' => new ezcWorkflowConditionIsAnything() ) ); // create nodes for the second branch of execution here..
// add the outnodes and set the conditions on the exclusive choice
$choice->addConditionalOutNode( new ezcWorkflowConditionIsAnything() , $branch1 );
$choice->addConditionalOutNode( new ezcWorkflowConditionIsAnything() , $branch2 );
// Merge the two branches together and continue execution.
$merge = new ezcWorkflowNodeSimpleMerge();
$merge->addInNode( $branch1 );
$merge->addInNode( $branch2 );
$merge->addOutNode( $w->endNode );
echo "2count workflow:".count($w)."<br/>";
echo "2count nodes:".count($w->nodes)."<br/>";