Esempio n. 1
0
 function addArchiveWorkflowUnit($workflowID)
 {
     $table = 'workflowArchive';
     $archiveValues = array();
     $archiveValues['workflowid'] = $workflowID;
     $archiveValues['timestamp'] = dbs::selattribute('timestamp', 'workflow', 'workflowId=' . $workflowID);
     $archiveValues['plan'] = addslashes(serialize(graphPlanDatabaseAccess::getPlanGraphList($workflowID)));
     //$planValues['state'] = addslashes(serialize($plans));
     dbs::irrecord($table, $archiveValues, false);
 }
Esempio n. 2
0
<?php

include_once 'includes/configuration/core_configuration.php';
include_once "includes/commonPages/system_header.php";
if ($_SESSION['posted']) {
    //This form has been posted so prevent a refresh
    errors::errorMessage("The Form cannot be re-posted! Please go back to the home page");
} else {
    //Indicate the form has been posted
    $_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
Esempio n. 3
0
 function updatePlans($plans)
 {
     graphPlanDatabaseAccess::updatePlanGraphList($_POST['workflowID'], $plans);
 }
<?php

include_once 'includes/configuration/core_configuration.php';
include_once "includes/commonPages/system_header.php";
$workflowID = $_GET['workflowID'];
$graphPlanList = graphPlanDatabaseAccess::getPlanGraphList($workflowID);
echo '<ul>';
echo '<li>';
echo '<a href="popupSVG.php?mode=totalOrdering&workflowID=' . $workflowID . '">All Temporal Orderings</a><br><br>';
echo '<li>';
echo '<a href="popupSVG.php?mode=totalPlan&workflowID=' . $workflowID . '">All Plans </a><br><br>';
echo '</ul><hr noshade><ul>';
echo '<table cellpadding="7" class="sofT" border="0">';
?>

<tr>
	<td class="helpHed" >Plan</td>
	<td class="helpHed" colspan="3">Modes</td>
</tr>




<?php 
for ($index = 0; $index < sizeof($graphPlanList); $index++) {
    echo '<tr>';
    echo '<td class="helpBod">';
    echo $index;
    echo '</td>';
    echo '<td class="helpBod">';
    echo '<a href="popupSVG.php?plan=' . $index . '&mode=singularPlan&workflowID=' . $workflowID . '">Action Plan</a>';
Esempio n. 5
0
    /**
     * @return void
     * @param CoreWorkflowDatPacket $coreWorkflowDataPacket
     * @desc Displays the HTML for the each workflow item
    */
    function html_displayXML($coreWorkflowDataPacket)
    {
        $tdClass = 'helpBod';
        $planGroups = array();
        $formName = '';
        workflowDisplayHTML::workflowState($coreWorkflowDataPacket->getWorkflowId(), $coreWorkflowDataPacket->getData(), false);
        //Fetch plans from the database
        $planGraphList = graphPlanDatabaseAccess::getPlanGraphList($coreWorkflowDataPacket->getworkflowid());
        $possibleActions = actionPacket::processLoop($planGraphList, $coreWorkflowDataPacket->getworkflowid());
        if (sizeof($possibleActions)) {
            //Actions have been fouund
            $possibleActionsSize = sizeof($possibleActions);
            for ($actionPacketIndex = 0; $actionPacketIndex < $possibleActionsSize; $actionPacketIndex++) {
                $currentAction = $possibleActions[$actionPacketIndex]->getAction();
                $data = $currentAction->getData();
                $entryTimepoint = $currentAction->getName();
                $vars = $data[0]->getPredicateValues();
                $formName = $vars[0]->toString();
                $workflowCreator = $vars[1]->toString();
                //Convert into string form
                array_push($planGroups, $vars[2]->toString());
                //Check if this is a loop re-entry point
                if ($possibleActions[$actionPacketIndex]->checkForLoopReentry($entryTimepoint)) {
                    //Check we have not already save the state
                    if (!graphPlanDatabaseAccess::stateAlreadyUpdated($coreWorkflowDataPacket->getworkflowid(), $formName)) {
                        graphPlanDatabaseAccess::savePlanState($planGraphList, $coreWorkflowDataPacket->getworkflowid(), $formName);
                    }
                }
            }
            //Fetch the groups the user is a member of
            $groups = groups::getUserGroupNames($_SESSION['valid_user']);
            $groupString = "";
            $superuser = false;
            //Compare against the groups specified in the plans
            $groupsSize = sizeof($groups);
            for ($index = 0; $index < $groupsSize; $index++) {
                if ($groups[$index] == 'superuser') {
                    $superuser = true;
                } else {
                    $groupString .= $groups[$index];
                }
            }
            if (!$superuser) {
                $match = arrays::searchArray($planGroups, $groups);
            } else {
                $match = $planGroups[0];
            }
            ?>
		
	<td class="<?php 
            echo $tdClass;
            ?>
" width="172"><?php 
            echo string::sentence($formName);
            ?>
</td>
        
	<td class="<?php 
            echo $tdClass;
            ?>
" width="100"> <?php 
            echo string::sentence($workflowCreator);
            ?>
 </td>
        
	<td class="<?php 
            echo $tdClass;
            ?>
"> <?php 
            echo time::arrangedate($coreWorkflowDataPacket->getDate());
            ?>
 </td>

	<?php 
            workflowDisplayHTML::buttons($coreWorkflowDataPacket->getWorkflowId(), $match, $planGroups, $formName);
        }
    }
Esempio n. 6
0
 function processLoop($planGraphList, $workflowID)
 {
     //Find the next Actions
     $possibleActions = planComparison::compareActions($planGraphList, false);
     $loopResult = actionPacket::checkActionPacketsForLoop($possibleActions);
     if ($loopResult['loop']) {
         //Check to see if we are looping
         systemMessages::message("Workflow is Looping!");
         $planGraphList = graphPlanDatabaseAccess::getPlanState($workflowID, $loopResult['formName']);
         graphPlanDatabaseAccess::updatePlanGraphList($workflowID, $planGraphList);
         $possibleActions = planComparison::compareActions($planGraphList, false);
     }
     return $possibleActions;
 }