Class ProcedureProcess

  • All Implemented Interfaces:
    Process
    Direct Known Subclasses:
    PinstanceProcedure

    public abstract class ProcedureProcess
    extends DalBaseProcess
    The top level procedure process that all background database procedure processes should extend.
    Author:
    awolski
    • Field Detail

      • connection

        protected ConnectionProvider connection
        The Connection to the database used during the execution of the procedure.
      • logger

        protected ProcessLogger logger
        A logger object - output will be viewable in the process monitor log.
    • Constructor Detail

      • ProcedureProcess

        public ProcedureProcess()
    • Method Detail

      • init

        protected abstract void init​(ProcessBundle bundle)
        An initialization method is called before executing the procedure. Subclasses of the ProcedureProcess should initialize any parameters (such as client or organization) in this method.
        Parameters:
        bundle - the process bundle containing process and context specific information
      • doExecute

        public void doExecute​(ProcessBundle bundle)
                       throws Exception
        The method that will execute when this process fires.
        Specified by:
        doExecute in class DalBaseProcess
        Parameters:
        bundle - the process bundle containing process and context specific information
        Throws:
        Exception
      • setSQL

        protected final void setSQL​(String sql)
        Set the sql (procedure) that this process will execute.
        Parameters:
        sql - the sql/procedure to execute
      • setParams

        protected final void setParams​(String[] params,
                                       String[] types)
        Set the procedure's parameters and the parameter types.
        Parameters:
        params - the parameters for the procedure
        types - the types of the parameters
      • log

        protected void log​(String msg,
                           Exception e)
        Log an error to the process' output log (used by process monitor).
        Parameters:
        msg -
        e -
      • log

        protected void log​(String message,
                           ProcessContext context)
        Log a message to the process' output log (used by the process monitor).
        Parameters:
        message - the message to log
        context - the process' execution bundle/context