Interface RaiseEvent

    • Field Detail

      • KEY_JOBDESCRIPTION

        static final String KEY_JOBDESCRIPTION
        This will be replaced by Job.getDescription().
        See Also:
        Constant Field Values
      • KEY_JOBSTATUS

        static final String KEY_JOBSTATUS
        This will be replaced by Job.getStatus() for a job raise event only.
        See Also:
        Constant Field Values
      • KEY_JOBDEFINITION

        static final String KEY_JOBDEFINITION
        This will be replaced by the job definition name (without the GLOBAL prefix if it is in GLOBAL, otherwise with the partition as a prefix) for a job raise event only.
        See Also:
        Constant Field Values
      • KEY_JOBDEFINITION_NAME

        static final String KEY_JOBDEFINITION_NAME
        This will be replaced by the job definition name only, for a job raise event only.
        See Also:
        Constant Field Values
      • KEY_JOBDEFINITION_PARTITION

        static final String KEY_JOBDEFINITION_PARTITION
        This will be replaced by the job definition partition only, for a job raise event only.
        See Also:
        Constant Field Values
    • Method Detail

      • getErrorCode

        Long getErrorCode()
        Get the value for ErrorCode. (If StatusToRaiseOn is JobStatus.Error or JobStatus.Killed, and ErrorCode is non null, then the Event will only be raised if the Job.getStatus() is JobStatus.Error or JobStatus.Killed (as appropriate) and Job.ReturnCode() is the same as getErrorCode().)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getRaiseComment

        String getRaiseComment()
        Get the value for RaiseComment. (The comment to set in the RaiserComment field of the raised Event when the appropriate conditions are set. In the resulting string the following substitutions will take place:
        • ${jobid} will be replaced by Job.getJobId().
        • ${jobdescription} will be replaced by Job.getDescription().
        • ${jobstatus} will be replaced by Job.getStatus(), this will be the same as StatusToRaiseOn.
        ) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getStatusToRaiseOn

        JobStatus getStatusToRaiseOn()
        Get the value for StatusToRaiseOn. (The status that needs to be reached to raise the associated EventDefinition.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setErrorCode

        void setErrorCode​(Long newErrorCode)
        Set the value for ErrorCode. (If StatusToRaiseOn is JobStatus.Error or JobStatus.Killed, and ErrorCode is non null, then the Event will only be raised if the Job.getStatus() is JobStatus.Error or JobStatus.Killed (as appropriate) and Job.ReturnCode() is the same as getErrorCode().) This value is optional.
        Parameters:
        newErrorCode - the new value for ErrorCode.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setRaiseComment

        void setRaiseComment​(String newRaiseComment)
        Set the value for RaiseComment. (The comment to set in the RaiserComment field of the raised Event when the appropriate conditions are set. In the resulting string the following substitutions will take place:
        • ${jobid} will be replaced by Job.getJobId().
        • ${jobdescription} will be replaced by Job.getDescription().
        • ${jobstatus} will be replaced by Job.getStatus(), this will be the same as StatusToRaiseOn.
        ) This value is mandatory.
        Parameters:
        newRaiseComment - the new value for RaiseComment. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setStatusToRaiseOn

        void setStatusToRaiseOn​(JobStatus newStatusToRaiseOn)
        Set the value for StatusToRaiseOn. (The status that needs to be reached to raise the associated EventDefinition.) This value is mandatory.
        Parameters:
        newStatusToRaiseOn - the new value for StatusToRaiseOn. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.