You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2015/12/10 17:50:28 UTC
[15/23] airavata-php-gateway git commit: checking the job status
before setting
checking the job status before setting
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/62586cd2
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/62586cd2
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/62586cd2
Branch: refs/heads/develop
Commit: 62586cd22052bb467ccb4e3dfafc7ff298f9a26c
Parents: 974599e
Author: scnakandala <su...@gmail.com>
Authored: Tue Dec 1 15:21:11 2015 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Dec 1 15:21:11 2015 -0500
----------------------------------------------------------------------
app/libraries/AppUtilities.php | 2 ++
app/libraries/ExperimentUtilities.php | 21 ++++++++++++++-------
app/views/project/summary.blade.php | 4 ++--
3 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/62586cd2/app/libraries/AppUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AppUtilities.php b/app/libraries/AppUtilities.php
index b239280..3b3102d 100644
--- a/app/libraries/AppUtilities.php
+++ b/app/libraries/AppUtilities.php
@@ -324,6 +324,8 @@ class AppUtilities
CommonUtilities::print_error_message('<p>There was a problem getting the application interface.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+ } catch(Exception $ex){
+ return null;
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/62586cd2/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 0d6c960..c17cb64 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -815,7 +815,20 @@ class ExperimentUtilities
*/
public static function get_job_status(ExperimentModel $experiment)
{
- $jobStatus = Airavata::getJobStatuses(Session::get('authz-token'), $experiment->experimentId);
+ try{
+ $jobStatus = Airavata::getJobStatuses(Session::get('authz-token'), $experiment->experimentId);
+ if (isset($jobStatus) && count($jobStatus) > 0) {
+ $jobState = JobState::$__names[array_values($jobStatus)[0]->jobState];
+ } else {
+ $jobState = null;
+ }
+ return $jobState;
+ }catch (\Thrift\Exception\TException $ex){
+ return null;
+ }catch (Exception $ex){
+ return null;
+ }
+
//TODO - implement following logic with new data model.
/* if(!empty($experiment->workflowNodeDetailsList)){
if(!empty($experiment->workflowNodeDetailsList[0]->taskDetailsList)){
@@ -824,13 +837,7 @@ class ExperimentUtilities
}
}
}*/
- if (isset($jobStatus) && count($jobStatus) > 0) {
- $jobState = JobState::$__names[array_values($jobStatus)[0]->jobState];
- } else {
- $jobState = null;
- }
- return $jobState;
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/62586cd2/app/views/project/summary.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/summary.blade.php b/app/views/project/summary.blade.php
index 8ba35f6..a59f649 100755
--- a/app/views/project/summary.blade.php
+++ b/app/views/project/summary.blade.php
@@ -44,7 +44,7 @@
echo '</tr>';
foreach ($experiments as $experiment) {
- $expValues = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectId), true);
+ $expValues = ExperimentUtilities::get_experiment_values($experiment, $project, true);
$expValues["jobState"] = ExperimentUtilities::get_job_status($experiment);
$applicationInterface = AppUtilities::get_application_interface($experiment->executionId);
@@ -105,7 +105,7 @@
echo '<td><div class="' . $textClass . '">' . $expValues["experimentStatusString"] . '</div></td>';
- if ($expValues["jobState"]) echo '
+ if (isset($expValues["jobState"])) echo '
<td>' . $expValues["jobState"] . '</td>';
else
echo '<td></td>';