Class WorkflowUtil


  • public abstract class WorkflowUtil
    extends java.lang.Object
    The WorkflowUtil class ...
    • Constructor Detail

      • WorkflowUtil

        public WorkflowUtil()
    • Method Detail

      • getWorkflowJobs

        public static java.util.Collection<Job> getWorkflowJobs​(JobManager jobManager,
                                                                WorkflowSession wfSession)
        Returns a collection of jobs for active workflow instances.
        Parameters:
        jobManager - used to query for sling jobs on workflow topics
        wfSession - used to retrieve the workflow models
        Returns:
        a collection of jobs for active workflow instances.
      • isStaleWorkflow

        public static boolean isStaleWorkflow​(Workflow workflow,
                                              java.util.Collection<Job> wfJobs)
        Deprecated.
        No longer useful (stale workflows don't occur enymore). Always return false. Can't be removed as it is a documented API.
        Checks if the job specified by the provided workflow instance exists in the collection of sling jobs.
        Parameters:
        workflow - to check for associate sling jobs, if any
        wfJobs - list of existing sling jobs in the system
        Returns:
        false if the workflow specifies a job but the job was not found, true otherwise.
      • getAuthorizableFromLastStep

        public static java.lang.String getAuthorizableFromLastStep​(WorkflowSession session,
                                                                   Workflow workflow,
                                                                   java.lang.String nodeId)
                                                            throws WorkflowException
        This method returns the userId of the user who completed the previous step.
        Parameters:
        session - workflow session
        workflow - workflow instance
        nodeId - node id of workflow node in question
        Returns:
        user id as string or null if no user could be matched
        Throws:
        WorkflowException