switch ($experimentStatusString) {
    case 'CREATED':
    case 'VALIDATED':
    case 'SCHEDULED':
    case 'CANCELED':
    case 'FAILED':
    case 'UNKNOWN':
        $editable = true;
        break;
    default:
        $editable = false;
        break;
}
if (isset($_POST['save']) || isset($_POST['launch'])) {
    $updatedExperiment = apply_changes_to_experiment($experiment);
    update_experiment($experiment->experimentID, $updatedExperiment);
    if (isset($_POST['save'])) {
        $experiment = get_experiment($_GET['expId']);
        // update local experiment variable
    } elseif (isset($_POST['launch'])) {
        launch_experiment($experiment->experimentID);
    }
}
//$transport->close();
?>


<h1>Edit Experiment</h1>


Esempio n. 2
0
global $transport;
use Airavata\API\Error\AiravataClientException;
use Airavata\API\Error\AiravataSystemException;
use Airavata\API\Error\ExperimentNotFoundException;
use Airavata\API\Error\InvalidRequestException;
use Airavata\Client\AiravataClientFactory;
use Airavata\Model\Workspace\Experiment\ExperimentState;
use Thrift\Exception\TTransportException;
use Thrift\Protocol\TBinaryProtocol;
use Thrift\Transport\TBufferedTransport;
use Thrift\Transport\TSocket;
use Airavata\API\AiravataClient;
if ($argc != 2) {
    echo 'Please provide the Experiment ID.' . "\n" . 'Usage: php updateExperiment.php <experiment_ID>' . "\n";
} else {
    update_experiment($argv[1]);
}
$transport->close();
/**
 * Get the experiment with the given ID
 * @param $expId
 * @return null
 */
function get_experiment($expId)
{
    global $airavataclient;
    try {
        return $airavataclient->getExperiment($expId);
    } catch (InvalidRequestException $ire) {
        echo 'Invalid Request Exception!' . "\n" . $ire->getMessage();
    } catch (ExperimentNotFoundException $enf) {