$_SESSION['posted'] = true; debug::transferFormPosts($_POST); //Fetch the plans from the database $planGraphList = graphPlanDatabaseAccess::getPlanGraphList($_POST['workflowID']); $result = planAction::actOnPlan($planGraphList, "edgeProgression"); $plannerProgress[0] = $result['actionPackets']; $match = false; $edgeProgressionResult = true; $goal = false; $indexTest = 1; while (!$match && $edgeProgressionResult && !$goal) { //Process all edgeProgression actions //Fetch the action packets $actionPackets = $plannerProgress[0]; //Check the edgeprogression action has been matched $edgeProgressionPacket = planningAgent::action($actionPackets, $_POST); //Retreive whether the edge progression test was passed $edgeProgressionResult = $edgeProgressionPacket['match']; //Retrive the selected action packet $selectedActionPacket = $edgeProgressionPacket['actionPacket']; if ($edgeProgressionResult) { //The edgeprogression test succeded //Check the chosen action packet if ($selectedActionPacket->atGoal()) { //At goal node $goal = true; planArchieving::archive($_POST['workflowID']); systemMessages::message("Goal node reached!"); } else { //Only one action packet should be returned $plans = $selectedActionPacket->getPlans();