Class TaskResult


  • public class TaskResult
    extends java.lang.Object
    With the TaskResult you can define a reaction to the end status of a task. Hence, you can activate this task repeatedly and/or start any other task when the preset status cannot be reached. The further processing within a JobPlan can also be specified.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean doNotStore  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TaskResult()  
      protected TaskResult​(com.uc4.util.XMLDocument doc, org.w3c.dom.Element task)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TaskResult copy()
      This method is used to return the copy of the TaskResult Object.
      UC4ObjectName getExecuteObject()
      Returns the object that is to be started when the specified status is not reached.
      TaskState getOkState()
      Gets the task status which should be reached.
      int getRepeatCount()
      Returns the number of repetitions.
      int getRepeatWaitMinutes()
      Returns the waiting time in minutes before the Job is repeated.
      boolean isOnlyAfterLastUnsuccessfulRepetition()
      Returns true if the selected object should not be started immediately but only after a specified number of repeated runs.
      void repeat​(int times, int minutes)
      Repeats the task.
      void setExecuteObject​(UC4ObjectName executeObject)
      Returns the object that is to be started when the specified status is not reached.
      void setOkState​(TaskState okState)
      Sets the task status which should be reached.
      void setOnlyAfterLastUnsuccessfulRepetition​(boolean onlyAfterLastUnsuccessfulRepetition)
      If onlyAfterLastUnsuccessfulRepetition is set to true the selected object will not be started immediately but only after a specified number of repeated runs.
      protected void store​(com.uc4.util.XMLDocument doc, org.w3c.dom.Element task)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • doNotStore

        protected boolean doNotStore
    • Constructor Detail

      • TaskResult

        protected TaskResult()
      • TaskResult

        protected TaskResult​(com.uc4.util.XMLDocument doc,
                             org.w3c.dom.Element task)
    • Method Detail

      • store

        protected void store​(com.uc4.util.XMLDocument doc,
                             org.w3c.dom.Element task)
      • getOkState

        public TaskState getOkState()
        Gets the task status which should be reached. If no status is selected, the result of the task is not monitored. If the task does not end on the specified status, the actions defined in Else will be executed.
        Returns:
        Task status
      • setOkState

        public void setOkState​(TaskState okState)
        Sets the task status which should be reached. If no status is selected, the result of the task is not monitored. If the task does not end on the specified status, the actions defined in Else will be executed.
        Parameters:
        okState - Task status which should be reached
      • isOnlyAfterLastUnsuccessfulRepetition

        public boolean isOnlyAfterLastUnsuccessfulRepetition()
        Returns true if the selected object should not be started immediately but only after a specified number of repeated runs.
        Returns:
        Boolean which is set to true if the object should not be started immediately
      • setOnlyAfterLastUnsuccessfulRepetition

        public void setOnlyAfterLastUnsuccessfulRepetition​(boolean onlyAfterLastUnsuccessfulRepetition)
        If onlyAfterLastUnsuccessfulRepetition is set to true the selected object will not be started immediately but only after a specified number of repeated runs.
        Parameters:
        onlyAfterLastUnsuccessfulRepetition - Boolean which is set to true if the object should not be started immediately
      • getExecuteObject

        public UC4ObjectName getExecuteObject()
        Returns the object that is to be started when the specified status is not reached.
        Returns:
        Object to start
      • setExecuteObject

        public void setExecuteObject​(UC4ObjectName executeObject)
        Returns the object that is to be started when the specified status is not reached.
        Parameters:
        executeObject - Object to start
      • getRepeatCount

        public int getRepeatCount()
        Returns the number of repetitions.
        Returns:
        Number of repetitions
      • getRepeatWaitMinutes

        public int getRepeatWaitMinutes()
        Returns the waiting time in minutes before the Job is repeated. 0 minutes stands for immediate repetition.
        Returns:
        Waiting time in minutes
      • repeat

        public void repeat​(int times,
                           int minutes)
        Repeats the task.
        Parameters:
        times - number of repetitions
        minutes - waiting time in minutes before the Job is repeated
      • copy

        public TaskResult copy()
        This method is used to return the copy of the TaskResult Object.
        Returns:
        TaskResult