Merge branch '8650-container-work-unit' into 9318-dashboard-uses-work-units
[arvados.git] / apps / workbench / app / models / work_unit.rb
index aea0f1270ef81b3a61196e78138bf2eb4311d916..ab32552342939f7327d2fa98f95b823ab2f0c165 100644 (file)
@@ -1,6 +1,5 @@
 class WorkUnit
-  # This is just an abstract class that documents the WorkUnit interface; a
-  # class can implement the interface without being a subclass of WorkUnit.
+  # This is an abstract class that documents the WorkUnit interface
 
   def label
     # returns the label that was assigned when creating the work unit
@@ -39,12 +38,12 @@ class WorkUnit
   end
 
   def success?
-    # returnis true if the work unit finished successfully,
+    # returns true if the work unit finished successfully,
     # false if it has a permanent failure,
     # and nil if the final state is not determined.
   end
 
-  def progress 
+  def progress
     # returns a number between 0 and 1
   end
 
@@ -92,16 +91,29 @@ class WorkUnit
     # returns uuid or pdh of output data, if any
   end
 
+  def outputs
+    # returns array containing uuid or pdh of output data of all children
+    # if no children, return output data if any
+  end
+
+  def child_summary
+    # summary status of any children of this work unit
+  end
+
+  def child_summary_str
+    # textual representation of child summary
+  end
+
   def can_cancel?
-    # returns if this work unit is cancelable
+    # returns true if this work unit can be canceled
   end
 
-  def uri
-    # returns the uri for this work unit
+  def readable?
+    # is the proxied object readable by current user?
   end
 
-  def child_summary
-    # summary status of any children of this work unit
+  def uri
+    # returns the uri for this work unit
   end
 
   def title
@@ -111,4 +123,49 @@ class WorkUnit
   def has_unreadable_children
     # accept it if you can't understand your own children
   end
+
+  # view helper methods
+  def link_to_log
+    # display a link to log if present
+  end
+
+  def walltime
+    # return walltime for a running or completed work unit
+  end
+
+  def cputime
+    # return cputime for a running or completed work unit
+  end
+
+  def queuedtime
+    # return queued time if the work unit is queued
+  end
+
+  def show_child_summary
+    # child summary for a running work unit
+  end
+
+  def is_running?
+    # is the work unit in running state?
+  end
+
+  def is_paused?
+    # is the work unit in paused state?
+  end
+
+  def is_finished?
+    # is the work unit in finished state?
+  end
+
+  def is_failed?
+    # is this work unit in failed state?
+  end
+
+  def ran_for_str
+    # display string for how long it has run
+  end
+
+  def started_and_active_for_str
+    # display string for how long it has been active
+  end
 end