Interface Job

  • All Superinterfaces:
    BusinessKeyObject, Detail, HasOwner, JobComp, Readable, SchedulerEntity, SchedulerEntityComp

    public interface Job
    extends JobComp, Detail, HasOwner, BusinessKeyObject, Readable
    A job represents an instantiated job definition or job chain. To instantiate a job definition or job chain, it must be prepared. A prepared JobDefinition is submitted once the session is persisted. The following code illustrates how to retrieve a system job definition and submit it.
    
          {
            // Get the job definition and prepare it for submittal
            Job j = jcsSession.getJobDefinitionByName("System_Sleep").prepare();
            // Persist session; any prepared job definitions will be submitted
            jcsSession.persist();
          }
          

    Jobs have scheduling parameters; the code above does not set the Queue scheduling parameter, for example. The queue scheduling parameter is mandatory and must be set, either on the job definition or on the job before it is submitted. In the case above, the queue was set on the job definition System_Sleep. Jobs also inherit job definition parameters. Mandatory parameters must always be set; if a mandatory parameter has no default value, the job definition cannot be submitted by events, for example. Likewise, when you attempt to submit a job definition without setting all mandatory parameters, and one or more mandatory job parameters have not been set, the submittal is vetoed by the system. In the above example, System_Sleep has a mandatory parameter (MilliSeconds), it has a default value and does not need to be explicitly set; its default value is 1000 ms.

    The following code illustrates how to retrieve a job definition, set a parameter, and submit it onto a queue.

    
          {
            // Get the queue
            Queue q = jcsSession.getQueueByName("System");
            // Get the job definition and prepare it for submittal
            Job j = jcsSession.getJobDefinitionByName("System_Sleep").prepare();
            // Set the queue
            j.setQueue(q);
            // Set the parameter
            JobParameter jp = j.getJobParameterByName("MilliSeconds");
            jp.setInValueNumber(new BigDecimal(1000));
            // Persist session; any prepared job definitions will be submitted
            jcsSession.persist();
          }
          

    A job completes when the script code returns a return code; this usually occurs at the end of processing. The job gets a final state based on its return code. Jobs can also have an external completion strategy; this means that the job remains running until another job sets its status. Jobs with external completion strategies are logical RedwoodScript jobs used to represent asynchronous web services, you can also use them outside of web services. A job will automatically be deleted if the job is in a final state and any of the following conditions are met:

    Error Handling:

    You should always check for 'null' when you retrieve objects from the repository because you never know, somebody might have changed the name of the job definition, for example. The following illustrates the use of 'null' checks, and how to specify the partition of an object:

    
          {
            // Get the partition, this is not necessary for the GLOBAL partition
            Partition part = jcsSession.getPartitionByName("GLOBAL");
            // Get the queue in partition, objects in GLOBAL partition can also be retrieved without
            // specifying the partition: jcsSession.getQueueByName("System")
            if (part != null)
            {
              Queue q = jcsSession.getQueueByName(part,"System")
              // Get the job definition in partition and prepare it to be run now
              Job j = jcsSession.getJobDefinitionByName(part, "System_Info").prepare();
              if (q != null && j != null)
              {
                //Set the queue
                j.setQueue(q);
                //Persist session; any prepared job definitions will be submitted
                jcsSession.persist();
              }
            }
          }
          
    • Method Detail

      • isActualJobChain

        boolean isActualJobChain()
        Get the value for ActualJobChain. ( Indicates whether this job corresponds directly to a job chain parent (as opposed to a step or call within). )
        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.
      • isActualJobChainCall

        boolean isActualJobChainCall()
        Get the value for ActualJobChainCall. ( Indicates whether this job corresponds directly to a job chain call (as opposed to a step). This will return true for a nested job chain parent job, as well. )
        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.
      • isActualJobChainStep

        boolean isActualJobChainStep()
        Get the value for ActualJobChainStep. ( Indicates whether this job corresponds directly to a job chain step (as opposed to a step or call within). )
        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.
      • getAllowedStartAtValues

        String[] getAllowedStartAtValues()
        Get the value for AllowedStartAtValue. ( Query the list of allowed values that the Start At attribute can be set to. The Start At attribute is used in job chains to start at a specific step. If no value is present (there is no list), any Start At value is allowed. If an empty list is returned, no Start At value is allowed. )
        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.
      • getChildOrder

        Long getChildOrder()
        Get the value for ChildOrder. (The index number of this child with respect to its siblings and its parent) 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.
      • getCreationTime

        DateTimeZone getCreationTime()
        Get the value for CreationTime. (The creation date of this Job. This is the time that persist() was called on the session that created this Job.) 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.
      • getDescription

        String getDescription()
        Get the value for Description. (The name of the job. During prepare the JobDefinition Description is copied to this field.) 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.
      • getSearchDescription

        String getSearchDescription()
        Get the value for SearchDescription. (The description converted to upper-case, used for searching.) 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.
      • getStatusForJobGroup

        JobStatusForJobGroup getStatusForJobGroup()
        Get the value for StatusForJobGroup. (Marks actions that make the job independent from the job group. The restart statuses are filled for all jobs.) 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.
      • getEstimates

        JobEstimates getEstimates()
        Get the value for Estimates. (Estimates for this job.) 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.
      • isInRecurrenceGroup

        boolean isInRecurrenceGroup()
        Get the value for InRecurrenceGroup. (Whether or not this job is part of a recurrence group.)
        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.
      • getJobGroupEndDate

        DateTimeZone getJobGroupEndDate()
        Get the value for JobGroupEndDate. (The job group ends at the defined date and time. )
        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.
      • getJobGroupJobCount

        Long getJobGroupJobCount()
        Get the value for JobGroupJobCount. (The current number of jobs that have been submitted for the job group. )
        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.
      • getJobGroupMaxJobs

        Long getJobGroupMaxJobs()
        Get the value for JobGroupMaxJobs. (The job group ends if the defined maximum of jobs is reached. )
        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.
      • getJobGroupPresubmitCount

        Long getJobGroupPresubmitCount()
        Get the value for JobGroupPresubmitCount. (The number of jobs that is scheduled in advance for the job group.)
        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.
      • getJobGroupStatus

        JobGroupStatus getJobGroupStatus()
        Get the value for JobGroupStatus. (The current status for the job group.)
        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.
      • getJobId

        Long getJobId()
        Get the value for JobId. (The Job ID for this Job. This is unique for every Job.) 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.
      • getKeepExpiration

        DateTimeZone getKeepExpiration()
        Get the value for KeepExpiration. (Holds the time after which the keep clause processor deletes this Job. This takes precedence over the keep specified on the job definition.)
        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.
      • getLastModificationTime

        DateTimeZone getLastModificationTime()
        Get the value for LastModificationTime. (The last modification date/time of the job.)
        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.
      • getMaintenance

        JobMaintenance getMaintenance()
        Get the value for Maintenance. (The maintenance level for the Job.) 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.
      • getMinimumOpenDuration

        Long getMinimumOpenDuration()
        Get the value for MinimumOpenDuration. (The minimum number of milliseconds that should be available in the TimeWindow of the Job, the Job's Queue or the intersection of both, before this job will be submitted.)
        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.
      • getMinimumOpenDurationExpression

        String getMinimumOpenDurationExpression()
        Get the value for MinimumOpenDurationExpression. (Expression for the minimum number of milliseconds that should be available in the TimeWindow of the Job, the Job's Queue or the intersection of both, before this job will be submitted. The value can be a REL expression or a number.)
        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.
      • getNextSubmitBaseTime

        DateTimeZone getNextSubmitBaseTime()
        Get the value for NextSubmitBaseTime. (The time that will be used as a start time for the calculation of the next RequestedStartTime for a Job with a SubmitFrame or a RecurrencePattern.) 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.
      • getNumChildJobs

        Long getNumChildJobs()
        Get the value for NumChildJobs. (The number of child Jobs this Job has. This is a performance optimization field.) 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.
      • getNumJobFiles

        Long getNumJobFiles()
        Get the value for NumJobFiles. (The number of JobFiles this Job have. This is a performance optimization field.) 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.
      • getNumJobLocks

        Long getNumJobLocks()
        Get the value for NumJobLocks. (The number of JobLocks this Job requires. This is a performance optimization field.) 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.
      • getNumJobMetaData

        Long getNumJobMetaData()
        Get the value for NumJobMetaData. (The number of JobMetaData items this Job has. This is a performance optimization field.) 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.
      • getNumJobNotes

        Long getNumJobNotes()
        Get the value for NumJobNotes. (The number of JobNotes this Job has. This is a performance optimization field.) 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.
      • getNumJobRaiseEvents

        Long getNumJobRaiseEvents()
        Get the value for NumJobRaiseEvents. (The number of JobRaiseEvents this Job has. This is a performance optimization field.) 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.
      • getNumJobWaitEvents

        Long getNumJobWaitEvents()
        Get the value for NumJobWaitEvents. (The number of JobWaitEvents this Job has. This is a performance optimization field.) 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.
      • getNumJobRuntimeLimits

        Long getNumJobRuntimeLimits()
        Get the value for NumJobRuntimeLimits. (The number of JobRuntimeLimits this Job has. This is a performance optimization field.) 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.
      • getNumJobParameters

        Long getNumJobParameters()
        Get the value for NumJobParameters. (The number of Parameters this Job has. This is a performance optimization field.) 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.
      • hasRuntimeParameters

        boolean hasRuntimeParameters()
        Get the value for HasRuntimeParameters. (Does this Job have Runtime Parameters. This is a performance optimization field.)
        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.
      • getOperatorMessages

        RWIterable<OperatorMessage> getOperatorMessages()
        Get the value for OperatorMessage. (Operator messages raised by this job.)
        Specified by:
        getOperatorMessages in interface JobComp
        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.
      • isParametersSetByUser

        boolean isParametersSetByUser()
        Get the value for ParametersSetByUser. (Used by job propagation to keep track if the parameters of a job were set by the user.)
        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.
      • getPriority

        Long getPriority()
        Get the value for Priority. (The priority of a job. Priority 1-100, higher has precedence; This field only has relevance if the resources or queue size is limited. The post-set listener propagates the priority to other jobs in the same recurrence.) 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.
      • getRecurrencePattern

        String getRecurrencePattern()
        Get the value for RecurrencePattern. (The recurrence pattern for this job.)
        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.
      • getRemoteCreationTime

        DateTimeZone getRemoteCreationTime()
        Get the value for RemoteCreationTime. (The date and time when the job was created in the remote system)
        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.
      • getRemoteEvent

        String getRemoteEvent()
        Get the value for RemoteEvent. (Event the job in the remote system is waiting for)
        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.
      • getRemoteId

        String getRemoteId()
        Get the value for RemoteId. (Unique identification of the job in the remote system.)
        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.
      • getRemoteOSUser

        String getRemoteOSUser()
        Get the value for RemoteOSUser. (The actual user the script is run as in the external system.)
        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.
      • getRemoteRunEnd

        DateTimeZone getRemoteRunEnd()
        Get the value for RemoteRunEnd. (The date and time when the job finished in the remote system)
        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.
      • getRemoteRunStart

        DateTimeZone getRemoteRunStart()
        Get the value for RemoteRunStart. (The date and time when the job started executing in the remote system)
        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.
      • getRemoteStatus

        String getRemoteStatus()
        Get the value for RemoteStatus. (Status of the job in the remote system)
        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.
      • getRemoteSystem

        String getRemoteSystem()
        Get the value for RemoteSystem. (Foreign subsystem that this job is actually executed in)
        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.
      • getRequestedStartTime

        DateTimeZone getRequestedStartTime()
        Get the value for RequestedStartTime. (This is the time that the User has requested the Job to start. Note, calling this method will set the RequestedStartTimeType of the Job to be UserSet.) 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.
      • getRequestedStartTimeType

        StartTimeType getRequestedStartTimeType()
        Get the value for RequestedStartTimeType. (Has the RequestedStartTime been explicitly set by the user, or has it been inherited from the Job's parent.) 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.
      • getRestartCount

        Long getRestartCount()
        Get the value for RestartCount. (Number of restarts left for this job)
        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.
      • getRestartJobId

        Long getRestartJobId()
        Get the value for RestartJobId. (The job id of the job that restarted this job.)
        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.
      • getReturnCode

        Long getReturnCode()
        Get the value for ReturnCode. (The return code of the processed command)
        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.
      • getRunEnd

        DateTimeZone getRunEnd()
        Get the value for RunEnd. (The date and time when the job finished.)
        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.
      • getRunStart

        DateTimeZone getRunStart()
        Get the value for RunStart. (The date and time the job started executing.)
        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.
      • getRunTime

        Long getRunTime()
        Get the value for RunTime. (The time in milliseconds that it took this job to finish.)
        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.
      • getRuntimeExpiration

        DateTimeZone getRuntimeExpiration()
        Get the value for RuntimeExpiration. (The date on which action will be taken if the job has not completed)
        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.
      • getScheduledStartTime

        DateTimeZone getScheduledStartTime()
        Get the value for ScheduledStartTime. (The scheduled start date and time of the job. This is calculated by the Dispatcher, and is dependent on any TimeWindows associated with the Job, or the Jobs Queue, and the RequestedStartTime set by the user. This value is also set on a best effort basis when submit() is called for this Job.) 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.
      • getStartAtValue

        String getStartAtValue()
        Get the value for StartAtValue. (At which job chain step the job should start running from.)
        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.
      • getStatus

        JobStatus getStatus()
        Get the value for Status. (The current status of the job) 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.
      • getLastStatusChangeTime

        DateTimeZone getLastStatusChangeTime()
        Get the value for LastStatusChangeTime. (The date and time of the last status change of the job. This is set automatically if the status changes and can be used to check whether a job is in a certain status longer than some time.) 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.
      • isHoldOnSubmit

        boolean isHoldOnSubmit()
        Get the value for HoldOnSubmit. (Should any submitted Job be held by default.)
        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.
      • getStepIteration

        Long getStepIteration()
        Get the value for StepIteration. (For job chain steps and their calls only: Iteration number.)
        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.
      • getKillSignal

        KillSignalType getKillSignal()
        Get the value for KillSignal. (The kill signal used to kill the job.)
        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.
      • getCompletionStrategy

        CompletionStrategyType getCompletionStrategy()
        Get the value for CompletionStrategy. (The kill signal used to kill the job.)
        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.
      • isForcedToRunNow

        boolean isForcedToRunNow()
        Get the value for ForcedToRunNow. (Whether this process is forced to run immediately, ignoring scheduling constraints.)
        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.
      • setChildOrder

        void setChildOrder​(Long newChildOrder)
        Set the value for ChildOrder. (The index number of this child with respect to its siblings and its parent) This value is mandatory.
        Parameters:
        newChildOrder - the new value for ChildOrder. 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.
      • setDescription

        void setDescription​(String newDescription)
        Set the value for Description. (The name of the job. During prepare the JobDefinition Description is copied to this field.) This value is mandatory.
        Parameters:
        newDescription - the new value for Description. 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.
      • setStatusForJobGroup

        void setStatusForJobGroup​(JobStatusForJobGroup newStatusForJobGroup)
        Set the value for StatusForJobGroup. (Marks actions that make the job independent from the job group. The restart statuses are filled for all jobs.) This value is mandatory.
        Parameters:
        newStatusForJobGroup - the new value for StatusForJobGroup. 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.
      • setJobGroupEndDate

        void setJobGroupEndDate​(DateTimeZone newJobGroupEndDate)
        Set the value for JobGroupEndDate. (The job group ends at the defined date and time. ) This value is optional.
        Parameters:
        newJobGroupEndDate - the new value for JobGroupEndDate.
        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.
      • setJobGroupMaxJobs

        void setJobGroupMaxJobs​(Long newJobGroupMaxJobs)
        Set the value for JobGroupMaxJobs. (The job group ends if the defined maximum of jobs is reached. ) This value is optional.
        Parameters:
        newJobGroupMaxJobs - the new value for JobGroupMaxJobs.
        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.
      • setJobGroupPresubmitCount

        void setJobGroupPresubmitCount​(Long newJobGroupPresubmitCount)
        Set the value for JobGroupPresubmitCount. (The number of jobs that is scheduled in advance for the job group.) This value is optional.
        Parameters:
        newJobGroupPresubmitCount - the new value for JobGroupPresubmitCount.
        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.
      • setKeepExpiration

        void setKeepExpiration​(DateTimeZone newKeepExpiration)
        Set the value for KeepExpiration. (Holds the time after which the keep clause processor deletes this Job. This takes precedence over the keep specified on the job definition.) This value is optional.
        Parameters:
        newKeepExpiration - the new value for KeepExpiration.
        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.
      • setMinimumOpenDuration

        void setMinimumOpenDuration​(Long newMinimumOpenDuration)
        Set the value for MinimumOpenDuration. (The minimum number of milliseconds that should be available in the TimeWindow of the Job, the Job's Queue or the intersection of both, before this job will be submitted.) This value is optional.
        Parameters:
        newMinimumOpenDuration - the new value for MinimumOpenDuration.
        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.
      • setMinimumOpenDurationExpression

        void setMinimumOpenDurationExpression​(String newMinimumOpenDurationExpression)
        Set the value for MinimumOpenDurationExpression. (Expression for the minimum number of milliseconds that should be available in the TimeWindow of the Job, the Job's Queue or the intersection of both, before this job will be submitted. The value can be a REL expression or a number.) This value is optional.
        Parameters:
        newMinimumOpenDurationExpression - the new value for MinimumOpenDurationExpression.
        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.
      • setNextSubmitBaseTime

        void setNextSubmitBaseTime​(DateTimeZone newNextSubmitBaseTime)
        Set the value for NextSubmitBaseTime. (The time that will be used as a start time for the calculation of the next RequestedStartTime for a Job with a SubmitFrame or a RecurrencePattern.) This value is mandatory.
        Parameters:
        newNextSubmitBaseTime - the new value for NextSubmitBaseTime. 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.
      • setPriority

        void setPriority​(Long newPriority)
        Set the value for Priority. (The priority of a job. Priority 1-100, higher has precedence; This field only has relevance if the resources or queue size is limited. The post-set listener propagates the priority to other jobs in the same recurrence.) This value is mandatory.
        Parameters:
        newPriority - the new value for Priority. 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.
      • setRecurrencePattern

        void setRecurrencePattern​(String newRecurrencePattern)
        Set the value for RecurrencePattern. (The recurrence pattern for this job.) This value is optional.
        Parameters:
        newRecurrencePattern - the new value for RecurrencePattern.
        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.
      • setRequestedStartTime

        void setRequestedStartTime​(DateTimeZone newRequestedStartTime)
        Set the value for RequestedStartTime. (This is the time that the User has requested the Job to start. Note, calling this method will set the RequestedStartTimeType of the Job to be UserSet.) This value is mandatory.
        Parameters:
        newRequestedStartTime - the new value for RequestedStartTime. 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.
      • setRestartCount

        void setRestartCount​(Long newRestartCount)
        Set the value for RestartCount. (Number of restarts left for this job) This value is optional.
        Parameters:
        newRestartCount - the new value for RestartCount.
        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.
      • setRestartJobId

        void setRestartJobId​(Long newRestartJobId)
        Set the value for RestartJobId. (The job id of the job that restarted this job.) This value is optional.
        Parameters:
        newRestartJobId - the new value for RestartJobId.
        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.
      • setReturnCode

        void setReturnCode​(Long newReturnCode)
        Set the value for ReturnCode. (The return code of the processed command) This value is optional.
        Parameters:
        newReturnCode - the new value for ReturnCode.
        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.
      • setStartAtValue

        void setStartAtValue​(String newStartAtValue)
        Set the value for StartAtValue. (At which job chain step the job should start running from.) This value is optional.
        Parameters:
        newStartAtValue - the new value for StartAtValue.
        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.
      • setHoldOnSubmit

        void setHoldOnSubmit​(boolean newHoldOnSubmit)
        Set the value for HoldOnSubmit. (Should any submitted Job be held by default.)
        Parameters:
        newHoldOnSubmit - the new value for HoldOnSubmit.
        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.
      • createConstraintContext

        ConstraintContext createConstraintContext()
        Create a ConstraintContext so that the constraints can be verified.
        Returns:
        The ConstraintContext
      • createJobDefinitionAlertSourceFor

        JobDefinitionAlertSource createJobDefinitionAlertSourceFor()
        Creates a new Job Definition Alert Source. Sets the job definition match pattern to exactly the job definition of the current job. Adds job definition parameter matches using the names and values of all key parameters of the job definition.
        Returns:
        The Job Definition Alert Source.
      • getJobParameterByName

        JobParameter getJobParameterByName​(String parameterName)
        Return the JobParameter for the given name. The name is taken from the JobDefinitionParameter
        Parameters:
        parameterName - The name of the JobParameter
        Returns:
        The JobParameter for the given name, null if the parameter with that name could not be found
      • getRecurrenceJobs

        RWIterable<Job> getRecurrenceJobs()
        Return an iterator with all jobs in the recurrence for this job, including this. If the job is not in a recurrence group, the iterator will only include this job.
        Specified by:
        getRecurrenceJobs in interface JobComp
        Returns:
        The iterator over the all jobs of the recurrence that this job is in, including this job.
      • getExpandedJobList

        List<Job> getExpandedJobList()
        Returns a list of this job and its children that are to be shown in an expanded state; in general this is during the execution phase of a job.
        Returns:
        Returns a list of jobs.
      • isAllowedQueue

        boolean isAllowedQueue​(Queue queue)
        Returns true if the job can run on this queue.
        Parameters:
        queue - Return true if the job can run on the supplied queue.
        Returns:
        Returns true if the job can run on this queue.
      • isAllowedProcessServer

        boolean isAllowedProcessServer​(ProcessServer processServer)
        Returns true if the job can run on this process server.
        Parameters:
        processServer - Return true if the job can run on the supplied process server.
        Returns:
        Returns true if the job can run on this process server.
      • setRequestedStartTimeToParent

        void setRequestedStartTimeToParent()
                                    throws com.redwood.scheduler.api.exception.JobHasNoParentException
        Set the value for RequestedStart to be the same as the parent Job.
        Throws:
        com.redwood.scheduler.api.exception.JobHasNoParentException - Operation requires that the Job has a parent, but it does not.
      • createOperatorMessage

        OperatorMessage createOperatorMessage​(String text,
                                              String replyExpression)
        Create an operator message for this job. If a reply expression is set and the job is currently executing, the job status will be set to 'Console'
        Parameters:
        text - The text of the operator message
        replyExpression - A regular expression to which the reply must match, or null if no reply is expected
        Returns:
        The created OperatorMessage
      • evaluateJobChainCallInExpressionParameterMappings

        void evaluateJobChainCallInExpressionParameterMappings()
        If this is a jobchain call evaluates its JobChainCallInExpressionParameterMappings. Can throw runtime exception ParameterInMappingNotFoundException if the job definition parameter cannot be found on the job.
      • removeFromRecurrenceGroup

        void removeFromRecurrenceGroup()
        Remove this job from the recurrence group that it belongs to.
      • markForArchive

        void markForArchive​(String server,
                            String mark,
                            DateTimeZone deletionDate)
        Mark a job for archiving (requires archiving module).
        Parameters:
        server - The server to archive to, may be null to archive to the default server.
        mark - The mark to apply.
        deletionDate - Date after which the job may be automatically deleted by the archiving system if it has been archived to the archive server. Set to null to manage deletion manually.
      • getRelativeJob

        Job getRelativeJob​(String jobName)
                    throws com.redwood.scheduler.api.exception.JobNotFoundRuntimeException,
                           com.redwood.scheduler.api.exception.IncorrectFormatRuntimeException
        Get the job by name of the job in the current job chain.
        Parameters:
        jobName - The name of the relative job
        Returns:
        The relative job
        Throws:
        com.redwood.scheduler.api.exception.JobNotFoundRuntimeException - A request was made for a job, however the job did not exist.
        com.redwood.scheduler.api.exception.IncorrectFormatRuntimeException - An expression is not syntactically correct.
      • getPreviousStepJob

        Job getPreviousStepJob()
                        throws com.redwood.scheduler.api.exception.StepDoesNotExistException,
                               com.redwood.scheduler.api.exception.NotWithinAChainException
        Get the previous step job.
        This method can be called from a job that corresponds to a step or a call.
        Returns:
        The last non-skipped previous step job instance.

        What's the previous step: Formally, the previous JobChainStep is the previous step in the list of steps ordered by their step sequence number.
        What's a skipped step job: A step job is skipped when the step precondition did not succeed. In this case a new job instance for that step is created and started later.

        Exception: When there is no non-skipped job instance of the previous step, the last skipped job instance of the previous step is returned.

        Throws:
        com.redwood.scheduler.api.exception.StepDoesNotExistException - The JobChain does not contain the requested step
        com.redwood.scheduler.api.exception.NotWithinAChainException - This job is neither a step nor a call of a JobChain
      • getNextStepJob

        Job getNextStepJob()
                    throws com.redwood.scheduler.api.exception.StepDoesNotExistException,
                           com.redwood.scheduler.api.exception.NotWithinAChainException
        Get the next step job.
        This method can be called from a job that corresponds to a step or a call.
        Returns:
        The last non-skipped next step job instance.

        What's the next step: Formally, the next JobChainStep is the next step in the list of steps ordered by their step sequence number.
        What's a skipped step job: A step job is skipped when the step precondition did not succeed. In this case a new job instance for that step is created and started later.

        Exception: When there is no non-skipped job instance of the next step, the last skipped job instance of the next step is returned.

        Throws:
        com.redwood.scheduler.api.exception.StepDoesNotExistException - The JobChain does not contain the requested step
        com.redwood.scheduler.api.exception.NotWithinAChainException - This job is neither a step nor a call of a JobChain
      • setStatusExternal

        void setStatusExternal​(JobStatus jobStatus)
        Set the status of a job that has CompletionStrategy of CompletionStrategyType.External.
        Parameters:
        jobStatus - New status, must be JobStatus.Completed, JobStatus.Error, or JobStatus.Unknown.
      • setUpdateAction

        void setUpdateAction​(UpdateFutureJobActionType actionType)
        Set the action to be executed by the UpdateFutureJobsActionWorker and start it. The action is set by creating an UpdateFutureJobAction object for this job with the requested action. This triggers an Action Worker to perform the action. An update is performed by creating a new job and canceling the current job. The job ids are swapped.
        Parameters:
        actionType - Action to be executed by the UpdateFutureJobsActionWorker.
      • getRecurrenceInfo

        RecurrenceInfo getRecurrenceInfo()
        Returns a RecurrenceInfo object that gives access to the details of the recurrence that is coded in the recurrence pattern string. Returns null if the pattern string is null or invalid.
        Returns:
        The RecurrenceInfo object
      • getObjectTagsFromQueue

        RWIterable<ObjectTag> getObjectTagsFromQueue()
        Returns an RWIterable with ObjectTag instances from the Queue (this is a convenience method, you can get it from Queue directly as well). If the Queue is not set, returns an empty RWIterable.
        Specified by:
        getObjectTagsFromQueue in interface JobComp
        Returns:
        RWIterable with ObjectTag instances when present, an empty RWIterable otherwise.
      • getObjectTagsFromJobDefinition

        RWIterable<ObjectTag> getObjectTagsFromJobDefinition()
        Returns an RWIterable with ObjectTag instances from the JobDefinition of the Job (this is a convenience method, you can get it from JobDefinition directly as well). If the JobDefinition is not set, returns an empty RWIterable.
        Specified by:
        getObjectTagsFromJobDefinition in interface JobComp
        Returns:
        Iterator with RWIterable instances when present, empty RWIterable otherwise.
      • getObjectTagFromQueue

        ObjectTag getObjectTagFromQueue​(String objectTagDefinitionName)
        Returns the ObjectTag from the Queue for given ObjectTagDefinition BusinessKey or name if present, null otherwise (this is a convenience method, you can get it from Queue directly as well). If the Queue is not set, returns null.
        Parameters:
        objectTagDefinitionName - BusinessKey or name of an ObjectTagDefinition. If only the name is provided the ObjectTagDefinition will be retrieved from the default partition
        Returns:
        ObjectTag when present, null otherwise.
      • getObjectTagFromJobDefinition

        ObjectTag getObjectTagFromJobDefinition​(String objectTagDefinitionBusinessKey)
        Returns the ObjectTag from the JobDefinition for given ObjectTagDefinition BusinessKey or name if present, null otherwise (this is a convenience method, you can get it from JobDefinition directly as well). If the JobDefinition is not set, returns null.
        Parameters:
        objectTagDefinitionBusinessKey - BusinessKey or name of an ObjectTagDefinition. If only the name is provided the ObjectTagDefinition will be retrieved from the default partition
        Returns:
        ObjectTag when present, null otherwise.
      • getMaximumConcurrentExecutionCount

        Long getMaximumConcurrentExecutionCount()
        Returns the number that allows for maximum concurrent processing if applied to the license key for the global execution limit. It throws a InvalidStatusForMaximumConcurrentExecutionCountException if called for a job in a non-final status.
        Returns:
        The maximum number of jobs that could theoretically run in parallel.
      • createLinkedJobFile

        JobFile createLinkedJobFile​(JobFile jobFileToLink,
                                    String jobFileName,
                                    Long jobFileOrder)
        Creates a JobFile that will be linked to another JobFile.
        Parameters:
        jobFileToLink - The JobFile to be linked to.
        jobFileName - The name of the JobFile to be created.
        jobFileOrder - The order of the JobFile to be created.
        Returns:
        A new JobFile that is linked to another JobFile.
      • explainJobStatus

        String explainJobStatus()
        Explain why the Job is in its current status. This currently handles EventWait and Queued.
        Returns:
        The explanation of why the Job is in its current status.
      • explainJobStatusHTML

        String explainJobStatusHTML()
        Explain why the Job is in its current status, in HTML. This currently handles EventWait and Queued.
        Returns:
        The explanation of why the Job is in its current status.
      • hold

        JobStatus hold()
        Hold a job, put it in the held state.
        Returns:
        The status of the held job, after it's been held.
      • release

        JobStatus release()
        Release a job that is in the held state.
        Returns:
        The status of the released job, after it's been released, or null if the job is already released.
      • enable

        JobStatus enable()
        Enable a job that is currently disabled. Only jobs that are steps or calls in a jobchain can be enabled. In addition, only jobs that are currently disabled can be enabled.
        Returns:
        The status of the disabled job, after it's been enabled, or null if the job is already enabled.
      • disable

        JobStatus disable()
        Disable a job. Only jobs that are steps or calls in a jobchain can be disabled. In addition, they can only disabled if they have not yet starting running.
        Returns:
        The status of the job, after it's been disabled.
      • kill

        JobStatus kill()
        Kill a job that is currently executing
        Returns:
        The status of the killed job, after it's been killed.
      • cancel

        JobStatus cancel()
        Cancel a job that is not being executed yet
        Returns:
        The status of the canceled job, after it's been canceled.
      • restart

        Job restart()
        Restart the job by submitting a new job with the same parameters. Recurrence settings for this job will be ignored.
        Returns:
        The restarted job.
      • restartFromError

        Job restartFromError()
        Restart the job, skipping the completed child jobs, to continue with the first error job. The latest version of the job definition is used.
        Returns:
        The restarted job.
      • restartRecurrence

        Job restartRecurrence()
        Restart the job group by submitting a new job group with the same parameters.
        Returns:
        The restarted job. This is the first of the presubmitted jobs.
      • restartFromStep

        void restartFromStep​(RestartStepOptions restartStepOptions)
        This will trigger the Restart Behaviour functionality, allowing an operator to restart a step in a running chain.
        Parameters:
        restartStepOptions - Container object with the options to restart from this step.
      • resubmit

        Job resubmit()
        Prepare a new job with the same parameters, but clear the recurrence attributes.
        Returns:
        The new prepared job.
      • resubmitRecurrence

        Job resubmitRecurrence()
        Prepare a new job with the same parameters, including all recurrence attributes.
        Returns:
        The new prepared job.
      • cancelRecurrence

        Long cancelRecurrence()
        Cancel all jobs in a recurrence group where this is possible. Submit frames and recurrences are stopped from resubmitting jobs by setting the end time to now. The scheduled jobs are canceled.
        Returns:
        The number of jobs that were canceled.
      • deleteRecurrence

        Long deleteRecurrence()
        Delete all jobs in a recurrence group where this is possible.
        Returns:
        The number of jobs that were deleted.
      • holdRecurrence

        Long holdRecurrence()
        Hold all jobs in a recurrence group where this is possible.
        Returns:
        The number of jobs that were held.
      • releaseRecurrence

        Long releaseRecurrence()
        Release all jobs in a job group where this is possible.
        Returns:
        The number of jobs that were released.
      • runNow

        JobStatus runNow()
        Start the process immediately, ignoring most scheduling constraints.
        Returns:
        The status of the process, after it's been started.
      • getNumRuntimeParameters

        Long getNumRuntimeParameters()
        Get the number of runtime parameters this job has.
        Returns:
        The number of runtime parameters this job has.
      • registerAsTemporaryObject

        void registerAsTemporaryObject​(NamedRootObject object)
        Register given NamedRootObject with this Process to become a temporary object. Register given NamedRootObject with this Process to become a temporary object. The given object will become a temporary object and will be removed once this Process is deleted. Temporary Objects will not be visible in the User Interface and will be renamed to an internal name. The passed in object can only be registered once, it is not allowed to register it with a different Process. You are allowed to register the object to a Process it is not part of.
        Parameters:
        object - The object to register as a temporary object.
      • getForcedProcessServer

        ProcessServer getForcedProcessServer()
        Get the ForcedProcessServer.
        Returns:
        ForcedProcessServer
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobChainCall

        JobChainCall getJobChainCall()
        Get the JobChainCall.
        Returns:
        JobChainCall
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobChainStep

        JobChainStep getJobChainStep()
        Get the JobChainStep.
        Returns:
        JobChainStep
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobDefinition

        JobDefinition getJobDefinition()
        Get the JobDefinition.
        Returns:
        JobDefinition
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getParentJob

        Job getParentJob()
        Get the ParentJob.
        Returns:
        ParentJob
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobGroup

        JobGroup getJobGroup()
        Get the JobGroup.
        Returns:
        JobGroup
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getOwnerSubject

        Subject getOwnerSubject()
        Get the OwnerSubject.
        Specified by:
        getOwnerSubject in interface HasOwner
        Returns:
        OwnerSubject
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getQueue

        Queue getQueue()
        Get the Queue.
        Returns:
        Queue
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getProcessServer

        ProcessServer getProcessServer()
        Get the ProcessServer.
        Returns:
        ProcessServer
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getPreviousProcessServer

        @Deprecated
        ProcessServer getPreviousProcessServer()
        Deprecated.
        Get the PreviousProcessServer.
        Returns:
        PreviousProcessServer
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getProxyProcessServer

        ProcessServer getProxyProcessServer()
        Get the ProxyProcessServer.
        Returns:
        ProxyProcessServer
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getSubmitFrame

        SubmitFrame getSubmitFrame()
        Get the SubmitFrame.
        Returns:
        SubmitFrame
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getTimeWindow

        TimeWindow getTimeWindow()
        Get the TimeWindow.
        Returns:
        TimeWindow
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getTimeWindowTimeZone

        TimeZone getTimeWindowTimeZone()
        Get the TimeWindowTimeZone.
        Returns:
        TimeWindowTimeZone
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobTimeZone

        TimeZone getJobTimeZone()
        Get the JobTimeZone.
        Returns:
        JobTimeZone
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getLastModifierSubject

        Subject getLastModifierSubject()
        Get the LastModifierSubject.
        Returns:
        LastModifierSubject
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getSAPNWCallbackVariant

        SAPNWCallbackVariant getSAPNWCallbackVariant()
        Get the SAPNWCallbackVariant.
        Returns:
        SAPNWCallbackVariant
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • setForcedProcessServer

        void setForcedProcessServer​(ProcessServer newForcedProcessServer)
        Set the value for ForcedProcessServer. This value is optional.
        Parameters:
        newForcedProcessServer - is the object to set ForcedProcessServer to. The process server on which this job must run, regardless of other possibilities.
      • setParentJob

        void setParentJob​(Job newParentJob)
        Set the value for ParentJob. This value is optional.
        Parameters:
        newParentJob - is the object to set ParentJob to. The parent Job of this Job.
      • setJobGroup

        void setJobGroup​(JobGroup newJobGroup)
        Set the value for JobGroup. This value is optional.
        Parameters:
        newJobGroup - is the object to set JobGroup to. The job group for a job, containing information about rescheduling the job.
      • setQueue

        void setQueue​(Queue newQueue)
        Set the value for Queue. This value is mandatory.
        Parameters:
        newQueue - is the object to set Queue to. The queue of a job. If this is null, then the object cannot be persisted.
      • setSubmitFrame

        void setSubmitFrame​(SubmitFrame newSubmitFrame)
        Set the value for SubmitFrame. This value is optional.
        Parameters:
        newSubmitFrame - is the object to set SubmitFrame to. The submit frame of this job.
      • setTimeWindow

        void setTimeWindow​(TimeWindow newTimeWindow)
        Set the value for TimeWindow. This value is optional.
        Parameters:
        newTimeWindow - is the object to set TimeWindow to. The time window this job must run in.
      • setTimeWindowTimeZone

        void setTimeWindowTimeZone​(TimeZone newTimeWindowTimeZone)
        Set the value for TimeWindowTimeZone. This value is optional.
        Parameters:
        newTimeWindowTimeZone - is the object to set TimeWindowTimeZone to. Timezone with which time windows are evaluated for the job.
      • setJobTimeZone

        void setJobTimeZone​(TimeZone newJobTimeZone)
        Set the value for JobTimeZone. This value is optional.
        Parameters:
        newJobTimeZone - is the object to set JobTimeZone to. The time zone of this job, used to represent all scheduling times of the job.
      • setSAPNWCallbackVariant

        void setSAPNWCallbackVariant​(SAPNWCallbackVariant newSAPNWCallbackVariant)
        Set the value for SAPNWCallbackVariant. This value is optional.
        Parameters:
        newSAPNWCallbackVariant - is the object to set SAPNWCallbackVariant to. Link a job to a SAP NW callback variant.
      • getChildJobs

        RWIterable<Job> getChildJobs()
        Get an RWIterable over a collection of ChildJobs, the collection will be ordered by ChildOrder. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. The parent Job of this Job.
        Specified by:
        getChildJobs in interface JobComp
        Returns:
        An RWIterable over a collection of Job objects , the collection will be ordered by ChildOrder.
      • getJobData

        RWIterable<JobDatum> getJobData()
        Get an RWIterable over an ordered collection of JobData. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. The MetaData associated with a Job.
        Specified by:
        getJobData in interface JobComp
        Returns:
        An RWIterable over an ordered collection of JobDatum objects .
      • getJobDatumByDatumDefinition

        JobDatum getJobDatumByDatumDefinition​(DatumDefinition datumDefinition)
        Get the JobDatum by JobDatum.
        Parameters:
        datumDefinition -
        Returns:
        the JobDatum, or null if it could not be found
      • getJobFiles

        RWIterable<JobFile> getJobFiles()
        Get an RWIterable over a collection of JobFiles, the collection will be ordered by FileOrder. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. A job file.
        Specified by:
        getJobFiles in interface JobComp
        Returns:
        An RWIterable over a collection of JobFile objects , the collection will be ordered by FileOrder.
      • createJobFile

        JobFile createJobFile()
        Create a new JobFile linked to this object.
        Returns:
        a new JobFile.
      • getJobFileByFileOrder

        JobFile getJobFileByFileOrder​(Long fileOrder)
        Get the JobFile by JobFileOrder.
        Parameters:
        fileOrder -
        Returns:
        the JobFile, or null if it could not be found
      • getJobFileByName

        JobFile getJobFileByName​(String name)
        Get the JobFile by JobName.
        Parameters:
        name -
        Returns:
        the JobFile, or null if it could not be found
      • getJobNotes

        RWIterable<JobNote> getJobNotes()
        Get an RWIterable over an ordered collection of JobNotes. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. The notes for a job.
        Specified by:
        getJobNotes in interface JobComp
        Returns:
        An RWIterable over an ordered collection of JobNote objects .
      • createJobNote

        JobNote createJobNote()
        Create a new JobNote linked to this object.
        Returns:
        a new JobNote.
      • getJobParameters

        RWIterable<JobParameter> getJobParameters()
        Get an RWIterable over a collection of JobParameters, the collection will be ordered by DisplayOrder. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. Job parameters.
        Specified by:
        getJobParameters in interface JobComp
        Returns:
        An RWIterable over a collection of JobParameter objects , the collection will be ordered by DisplayOrder.
      • getJobRaiseEventByStatusToRaiseOnEventDefinition

        JobRaiseEvent getJobRaiseEventByStatusToRaiseOnEventDefinition​(JobStatus statusToRaiseOn,
                                                                       EventDefinition eventDefinition)
        Get the JobRaiseEvent by JobRaiseEvents.
        Parameters:
        statusToRaiseOn -
        eventDefinition -
        Returns:
        the JobRaiseEvent, or null if it could not be found
      • getJobRuntimeLimitByName

        JobRuntimeLimit getJobRuntimeLimitByName​(String name)
        Get the JobRuntimeLimit by JobName.
        Parameters:
        name -
        Returns:
        the JobRuntimeLimit, or null if it could not be found
      • getJobWaitEventByEventDefinition

        JobWaitEvent getJobWaitEventByEventDefinition​(EventDefinition eventDefinition)
        Get the JobWaitEvent by JobWaitEvents.
        Parameters:
        eventDefinition -
        Returns:
        the JobWaitEvent, or null if it could not be found
      • getPublishApproval

        PublishApproval getPublishApproval()
        Get the PublishApproval. The related PublishApproval job that created this publish approval
        Returns:
        nullPublishApproval
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getUserMessage

        UserMessage getUserMessage()
        Get the UserMessage. The related UserMessage job that created this user message
        Returns:
        nullUserMessage
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • checkViewPrivilege

        RequiredPermission checkViewPrivilege()
        Check whether or not the view action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkCreateJobNotesPrivilege

        RequiredPermission checkCreateJobNotesPrivilege()
        Check whether or not the createJobNotes action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkEditPrivilege

        RequiredPermission checkEditPrivilege()
        Check whether or not the edit action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkDeletePrivilege

        RequiredPermission checkDeletePrivilege()
        Check whether or not the delete action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.