Interface RestartableScriptObject

  • All Known Subinterfaces:
    PostRunningActionScriptObject, PreExecutingActionScriptObject
    All Known Implementing Classes:
    ActionScriptObject

    public interface RestartableScriptObject
    Triggers and actions may fail if another user or the system updates the object. To ensure that they always run triggers and actions may be restarted. The trigger/action must call setMaximumRestarts(int) and pass in a number greater than zero to be restarted. For example, if you call setMaximumRestarts(5) then the maximum number of times this trigger/action will be restarted for a given modification to a job is 5 times. In general you should call setMaximumRestarts() as the first line in your trigger/action if you want it to be restarted.
    • Method Detail

      • setFailJobOnError

        void setFailJobOnError​(boolean newValue)
        Set the 'fail job on error' flag. This flag determines if the job should be failed if the action fails. Set to true to fail the job if the action fails, and false to ignore action failures. The default value is true.
        Parameters:
        newValue - new value.
      • getFailJobOnError

        boolean getFailJobOnError()
        Get the current value of the fail job on error flag.
        Returns:
        the current value.
        See Also:
        .
      • getMaximumRestarts

        int getMaximumRestarts()
        Get the maximum number of restarts allowed for this trigger/action.
        Returns:
        the maximum number of restarts allowed.
        See Also:
        .
      • logRestarts

        boolean logRestarts()
        Should restarts of this trigger/action be logged?
        Returns:
        true if restarts should be logged, false otherwise.
      • setLogRestarts

        void setLogRestarts​(boolean newValue)
        Set if restarts of this trigger/action should be logged.
        Parameters:
        newValue - true if restarts should be logged, false otherwise.
      • setMaximumRestarts

        void setMaximumRestarts​(int newValue)
        Set the maximum number of restarts of allowed for this trigger/action. This is a total count for a given modification.
        Parameters:
        newValue - the maximum number of restarts allowed.
      • getRestartCount

        int getRestartCount()
        Get the number of restarts for this trigger/action.
        Returns:
        the number of restarts so far.
      • getPersistentMap

        Map<Object,​Object> getPersistentMap()
        Get the persistent map. This can be used to store data across restarts of the trigger/action.
        Returns:
        the persistent map.
      • setForceRestart

        void setForceRestart​(boolean newValue,
                             String newReason)
        Set the value of the force restart flag for this trigger/action. Forced restarts do not effect the restart count.
        Parameters:
        newValue - true to force a restart, false to suppress a previous request to force a restart.
        newReason - the reason for the restart, will be logged.
      • getForceRestart

        boolean getForceRestart()
        Get the value of the Force restart flag for this trigger/action.
        Returns:
        the value of the force restart flag.
      • getRestartReason

        String getRestartReason()
        Get the restart reason for this trigger/action.
        Returns:
        the restart reason.