JAL-4199 Initialize jobs and tasks with status CREATED
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Thu, 22 Jun 2023 13:28:58 +0000 (15:28 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Thu, 22 Jun 2023 13:28:58 +0000 (15:28 +0200)
src/jalview/ws2/actions/AbstractPollableTask.java
src/jalview/ws2/actions/BaseJob.java
src/jalview/ws2/api/JobStatus.java

index e692c68..b61711c 100644 (file)
@@ -49,7 +49,7 @@ public abstract class AbstractPollableTask<T extends BaseJob, R> implements Task
 
   private final TaskEventSupport<R> eventHandler;
 
-  protected JobStatus taskStatus = null;
+  protected JobStatus taskStatus = JobStatus.CREATED;
 
   private Future<?> future = null;
 
index 945c7b0..8376d20 100644 (file)
@@ -31,7 +31,7 @@ public abstract class BaseJob implements JobI
 
   protected final List<SequenceI> inputSeqs;
 
-  protected JobStatus status = null;
+  protected JobStatus status = JobStatus.CREATED;
 
   protected String log = "";
 
index 3341a69..8957343 100644 (file)
@@ -2,6 +2,8 @@ package jalview.ws2.api;
 
 public enum JobStatus
 {
+  /** Initial status before the job is started. */
+  CREATED,
   /** Job has invalid inputs and cannot be started. */
   INVALID,
   /** Job is created and ready for submission. */
@@ -39,6 +41,7 @@ public enum JobStatus
     case CANCELLED:
     case SERVER_ERROR:
       return true;
+    case CREATED:
     case READY:
     case SUBMITTED:
     case QUEUED:
@@ -60,6 +63,7 @@ public enum JobStatus
       JobStatus.UNKNOWN, // unknown prevents successful completion but not
                          // running or failure
       JobStatus.READY,
+      JobStatus.CREATED,
       JobStatus.SUBMITTED,
       JobStatus.QUEUED,
       JobStatus.RUNNING,