Class JobControllerService

    • Field Detail

      • actionRetryDelayMins

        protected Integer actionRetryDelayMins
    • Constructor Detail

      • JobControllerService

        public JobControllerService()
    • Method Detail

      • getJobDefinition

        public String getJobDefinition()
        Return the Job definition configuration (JSON format).
        Returns:
        Job definition configuration (JSON format)
      • setJobDefinition

        public void setJobDefinition​(String jobDefinition)
        Set the Job definition configuration (JSON format).
        Parameters:
        jobDefinition - the Job definition configuration (JSON format).
      • setJobControllerEnabled

        public void setJobControllerEnabled​(boolean enabled)
        Specify whether the Job Controller service is enabled.
        Parameters:
        enabled - specify whether the Job Controller service is enabled
      • setActionRetryDelayMins

        public void setActionRetryDelayMins​(Integer delayMins)
        Set the default action service retry delay minutes.
        Parameters:
        delayMins - the default action service retry delay minutes
      • getActionRetryDelayMins

        public Integer getActionRetryDelayMins()
        Returns:
        the Mins the default action service retry delay minutes
      • isLogJobHistory

        public boolean isLogJobHistory()
        Set the log job history.
        Returns:
        the logJobHistory
        Since:
        5.1.0
      • setLogJobHistory

        public void setLogJobHistory​(boolean logJobHistory)
        Return the log job history
        Parameters:
        logJobHistory - the logJobHistory to set
        Since:
        5.1.0
      • createJobWithClient

        public Job createJobWithClient​(Client client)
        Description copied from interface: IJobController
        Create a job with the client, initializing the first step and action and put in 'Ready' state.
        If the controller is configured to process the job immediately after creation, this method will also process the job before it is returned.
        Specified by:
        createJobWithClient in interface IJobController
        Parameters:
        client - the client organization which owns the job (required)
        Returns:
        a new job instance
        See Also:
        IJobController.createJobWithClient(Client)
      • createJobWithSubmission

        public Job createJobWithSubmission​(Submission submission)
        Description copied from interface: IJobController
        Create a job with the submission, initializing the first step and action, and using the given submission and put step action in 'Ready' state.
        If the controller is configured to process the job immediately after creation, this method will also process the job before it is returned. This can be useful to create an Task assigned to the user who created the job with the initial submission.
        Specified by:
        createJobWithSubmission in interface IJobController
        Parameters:
        submission - the initial job submission (required)
        Returns:
        a new job instance
        See Also:
        IJobController.createJobWithSubmission(Submission)
      • processJob

        public void processJob​(Job job,
                               boolean logHistory)
        Process the job when a job action is in a 'Ready' state.
        Parameters:
        job - the Job instance to process
        logHistory - log the job execution history
        Since:
        5.1.0
      • completedTaskSubmission

        public boolean completedTaskSubmission​(Submission submission)
        Description copied from interface: IJobController
        Provides a callback to tell the Job controller that the given task submission has been completed. The job controller should progress the associated task assign action status to 'Completed' and the next task wait action status to 'Ready'.
        Specified by:
        completedTaskSubmission in interface IJobController
        Parameters:
        submission - the completed task submission (required)
        Returns:
        true if the submission task was found and associated "Task Assigned" was set to "Completed" or false otherwise
        See Also:
        IJobController.completedTaskSubmission(Submission)
      • cancelledTaskSubmission

        public boolean cancelledTaskSubmission​(Submission submission)
        Description copied from interface: IJobController
        Provides a callback to tell the Job controller that the given task submission has been cancelled. The job controller should progress the associated task assign action status to 'Cancelled' and the next task wait action status to 'Ready'.
        Specified by:
        cancelledTaskSubmission in interface IJobController
        Parameters:
        submission - the cancelled task submission (required)
        Returns:
        true if the submission task was found and associated "Task Assigned" was set to "Cancelled" or false otherwise
        See Also:
        IJobController.cancelledTaskSubmission(Submission)
      • completedJobAsyncAction

        public boolean completedJobAsyncAction​(String jobActionKey)
        Description copied from interface: IJobController
        Provides a callback to tell the Job controller that the specified asynchronous action ('Job Async Action') has been completed. The job controller should progress the associated action status to 'Completed' and the next wait action status to 'Ready'.
        Specified by:
        completedJobAsyncAction in interface IJobController
        Parameters:
        jobActionKey - the unique job key identifier (required)
        Returns:
        true if the job async action was found and set to "Completed" or false otherwise
        See Also:
        IJobController.completedJobAsyncAction(String)
      • cancelJob

        public boolean cancelJob​(Job job)
        Description copied from interface: IJobController
        Cancel the job, abandon any Assigned or Saved Tasks and make submission data ready for purging.
        Specified by:
        cancelJob in interface IJobController
        Parameters:
        job - the job instance to cancel (required)
        Returns:
        true if the job was cancelled, or false if the job was already finished
        See Also:
        IJobController.cancelJob(Job)
      • isJobControllerEnabled

        public boolean isJobControllerEnabled()
        Description copied from interface: IJobController
        Return true if the job controller service is enabled and should be processed by the scheduled job. This property can be used to prevent a controllers jobs from being processed while some other maintenance action is being performed.
        Specified by:
        isJobControllerEnabled in interface IJobController
        Returns:
        true if the controller service is enabled
        See Also:
        IJobController.isJobControllerEnabled()
      • toString

        public String toString()
        Return the string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        the string representation of this object