function workflow_input($sid) { #echo 'Marking'; workflow_recurse($sid); #echo ', Executing'; workflow_execute($sid); #echo ', Done.'; }
function workflow_done($sid) { global $db; $sql = "select * from station where sid='" . $sid . "'"; $result = $db->fetchAll($sql); #file_put_contents('/tmp/info',"In workflow done(".$sid.",".$result[0]['status'].",".$result[0]['request'].")\n",FILE_APPEND); if ($result[0]['status'] == 'running' and $result[0]['request'] == 'waiting') { $columns['status'] = 'ready'; $columns['request'] = 'done'; $db->update("station", $columns, '"sid"=\'' . $sid . '\''); #file_put_contents('/tmp/info',"Executing (".$sid.")\n",FILE_APPEND); workflow_execute($sid); } else { if ($result[0]['request'] == 'update') { workflow_execute1($sid); } } }