Class ProcedureProcess
- java.lang.Object
-
- org.openbravo.service.db.DalBaseProcess
-
- org.openbravo.erpCommon.ad_process.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 Summary
Fields Modifier and Type Field Description protected ConnectionProvider
connection
The Connection to the database used during the execution of the procedure.protected ProcessLogger
logger
A logger object - output will be viewable in the process monitor log.-
Fields inherited from interface org.openbravo.scheduling.Process
COMPLETE, ERROR, EXECUTION_ID, KILLED, MISFIRED, PREVENT_CONCURRENT_EXECUTIONS, PROCESS_ID, PROCESS_NAME, PROCESSING, SCHEDULED, SUCCESS, SYSTEM_RESTART, UNSCHEDULED
-
-
Constructor Summary
Constructors Constructor Description ProcedureProcess()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doExecute(ProcessBundle bundle)
The method that will execute when this process fires.protected abstract void
init(ProcessBundle bundle)
An initialization method is called before executing the procedure.protected void
log(String msg, Exception e)
Log an error to the process' output log (used by process monitor).protected void
log(String message, ProcessContext context)
Log a message to the process' output log (used by the process monitor).protected void
setParams(String[] params, String[] types)
Set the procedure's parameters and the parameter types.protected void
setSQL(String sql)
Set the sql (procedure) that this process will execute.-
Methods inherited from class org.openbravo.service.db.DalBaseProcess
execute, isDoCommit, setDoCommit
-
-
-
-
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.
-
-
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 classDalBaseProcess
- 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 proceduretypes
- 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 logcontext
- the process' execution bundle/context
-
-