Interface TaskExecution


  • public interface TaskExecution
    Contains internal, non-configurable information about a planned task

    All configurable values can be found in the TaskDefinition. An object of TaskExecution only exists for already saved tasks.

    This is just a snapshot, changes from other users or the TaskPlanner are not reflected in one TaskExecution instance.

    See TaskDefinition on how to create new tasks.

    Since:
    taskplanner 3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ExecutionHistory getExecutionHistory()
      Returns the executionHistory of this Task.
      Those are information about past and possible current executions.
      long getLastModified()
      Get the time in ms since January 1, 1970 00:00:00.000 GMT when this task has been changed the last time.
      This only counts modifications of the settings, not manual or automatic executions.
      com.inet.id.GUID getOwnerId()
      get the ID of the user owning this task.
      java.util.Map<java.lang.String,​java.lang.String> getStateProperties()
      returns a live (read-writeable) map of properties for this task's execution which enables task components to maintain state, e.g.
      com.inet.id.GUID getTaskID()
      Get the unique ID of this task.
      boolean isRunning()
      Check if this task is currently running (one or more executions)
    • Method Detail

      • getTaskID

        com.inet.id.GUID getTaskID()
        Get the unique ID of this task. This can be used to read, update, execute or delete this task.
        Returns:
        the unique ID of this task which can be used to read, update, execute or delete this task.
        Since:
        taskplanner 3.0
      • getOwnerId

        com.inet.id.GUID getOwnerId()
        get the ID of the user owning this task.
        Returns:
        the name of the task owner.
        Since:
        taskplanner 3.2
      • getLastModified

        long getLastModified()
        Get the time in ms since January 1, 1970 00:00:00.000 GMT when this task has been changed the last time.
        This only counts modifications of the settings, not manual or automatic executions.
        Returns:
        last modified date in ms since January 1, 1970 00:00:00.000 GMT.
        Since:
        taskplanner 3.0
      • getExecutionHistory

        ExecutionHistory getExecutionHistory()
        Returns the executionHistory of this Task.
        Those are information about past and possible current executions.
        Returns:
        the executionHistory
        Since:
        taskplanner 3.0
      • isRunning

        boolean isRunning()
        Check if this task is currently running (one or more executions)

        Note that in a cloud environment with many nodes, a task may be running on any node and this returns true even if the task is running on an other node. Keep in mind that if an other node starts this task, no guarantees or assumptions can be made when the return value of this method on this node changes from false to true. However, it is guaranteed that the execution on the other node is reflected in getExecutionHistory() at the same time as this method reflects that change.

        Note that this object is a snapshot which does not reflect future changes, so the return value will never change.

        Returns:
        true if this task is running, otherwise false.
        Since:
        taskplanner 3.0
      • getStateProperties

        java.util.Map<java.lang.String,​java.lang.String> getStateProperties()
        returns a live (read-writeable) map of properties for this task's execution which enables task components to maintain state, e.g. triggers might store what they have already checked for, etc.
        Returns:
        map of state properties, never null
        Since:
        taskplanner 4.1