Interface BulkWorkflowRunner

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void complete​(Workspace workspace)
      Marks a Workspace as being complete, indicating all work has been processed.
      void complete​(Workspace workspace, Payload payload)
      Marks a payload as being completed.
      void forceTerminate​(Workspace workspace, Payload payload)
      Marks a payload being force terminated.
      org.apache.sling.commons.scheduler.ScheduleOptions getOptions​(Config config)
      If a non-null value is returned, the result of run(..) will be scheduled to run w these options.
      Runnable getRunnable​(Config config)  
      void initialize​(QueryHelper queryHelper, Config config)
      Collects and initializes the Workspace JCR structure with the payload nodes.
      void initialize​(Workspace workspace, int totalCount)
      Initialize the Bulk Workflow Manager workspace w the total count of items to process.
      void run​(Workspace workspace, Payload payload)
      Processes a payload under the Workspace.
      void start​(Workspace workspace)
      Starts work on the Workspace.
      void stop​(Workspace workspace)
      Stops (or pauses) work in the Workspace.
      void stop​(Workspace workspace, SubStatus subStatus)
      Stops (or pauses) work in the Workspace.
      void stopping​(Workspace workspace)
      Used to request stop of a Workspace however workspace may still continue to run in order to allow active payloads to complete.
      void stopWithError​(Workspace workspace)
      Stops (or pauses) work in the Workspace due to Error.
    • Method Detail

      • getRunnable

        Runnable getRunnable​(Config config)
        Parameters:
        config - the Config
        Returns:
        the runnable object that will be used to perform the work.
      • getOptions

        org.apache.sling.commons.scheduler.ScheduleOptions getOptions​(Config config)
        If a non-null value is returned, the result of run(..) will be scheduled to run w these options. If null the job will be immediately run in the same thread.
        Parameters:
        config - the Config
        Returns:
        The Sling Scheduler options or null;
      • initialize

        void initialize​(QueryHelper queryHelper,
                        Config config)
                 throws org.apache.sling.api.resource.PersistenceException,
                        javax.jcr.RepositoryException
        Collects and initializes the Workspace JCR structure with the payload nodes.
        Parameters:
        queryHelper - the QueryHelper
        config - the Config
        Throws:
        org.apache.sling.api.resource.PersistenceException
        javax.jcr.RepositoryException
      • initialize

        void initialize​(Workspace workspace,
                        int totalCount)
                 throws org.apache.sling.api.resource.PersistenceException
        Initialize the Bulk Workflow Manager workspace w the total count of items to process.
        Parameters:
        workspace - the Workspace
        totalCount - total number of items to process
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • start

        void start​(Workspace workspace)
            throws org.apache.sling.api.resource.PersistenceException
        Starts work on the Workspace.
        Parameters:
        workspace - the Workspace
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • stopping

        void stopping​(Workspace workspace)
               throws org.apache.sling.api.resource.PersistenceException
        Used to request stop of a Workspace however workspace may still continue to run in order to allow active payloads to complete.
        Parameters:
        workspace - the Workspace
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • stop

        void stop​(Workspace workspace)
           throws org.apache.sling.api.resource.PersistenceException
        Stops (or pauses) work in the Workspace.
        Parameters:
        workspace - the Workspace
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • stop

        void stop​(Workspace workspace,
                  SubStatus subStatus)
           throws org.apache.sling.api.resource.PersistenceException
        Stops (or pauses) work in the Workspace.
        Parameters:
        workspace - the Workspace
        subStatus - SubStatus used to identify cause of stopping for corner cases
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • stopWithError

        void stopWithError​(Workspace workspace)
                    throws org.apache.sling.api.resource.PersistenceException
        Stops (or pauses) work in the Workspace due to Error.
        Parameters:
        workspace - the Workspace
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • complete

        void complete​(Workspace workspace)
               throws org.apache.sling.api.resource.PersistenceException
        Marks a Workspace as being complete, indicating all work has been processed.
        Parameters:
        workspace - the Workspace
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • complete

        void complete​(Workspace workspace,
                      Payload payload)
               throws Exception
        Marks a payload as being completed.
        Parameters:
        workspace - the Workspace
        payload - the completed Payload
        Throws:
        Exception
      • run

        void run​(Workspace workspace,
                 Payload payload)
        Processes a payload under the Workspace.
        Parameters:
        workspace - the Workspace
        payload - the Payload to process
      • forceTerminate

        void forceTerminate​(Workspace workspace,
                            Payload payload)
                     throws Exception
        Marks a payload being force terminated.
        Parameters:
        workspace - the Workspace
        payload - the completed Payload
        Throws:
        Exception