Package org.openbravo.service.db
Class CallProcess
- java.lang.Object
-
- org.openbravo.service.db.CallProcess
-
public class CallProcess extends Object
This class is a service class to call a stored procedure using a set of parameters. TheProcessInstance
result is returned.- Author:
- mtaal
- See Also:
ProcessInstance
,Process
,Parameter
-
-
Constructor Summary
Constructors Constructor Description CallProcess()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcessInstance
call(String processName, String recordID, Map<String,String> parameters)
Calls a process with the specified name.ProcessInstance
call(String processName, String recordID, Map<String,String> parameters, Boolean doCommit)
Calls a process with the specified name.ProcessInstance
call(Process process, String recordID, Map<String,String> parameters)
Calls a process.ProcessInstance
call(Process process, String recordID, Map<String,String> parameters, Boolean doCommit)
Calls a process.ProcessInstance
callProcess(Process process, String recordID, Map<String,?> parameters)
Calls a process.ProcessInstance
callProcess(Process process, String recordID, Map<String,?> parameters, Boolean doCommit)
Calls a process.static CallProcess
getInstance()
static void
setInstance(CallProcess instance)
-
-
-
Method Detail
-
getInstance
public static CallProcess getInstance()
-
setInstance
public static void setInstance(CallProcess instance)
-
call
public ProcessInstance call(String processName, String recordID, Map<String,String> parameters, Boolean doCommit)
Calls a process with the specified name. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
processName
- the name of the stored procedure, must exist in the database, seeProcess.getProcedure()
.recordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parametersdoCommit
- do commit at the end of the procedure only if calledFromApp functionality is supported in the procedure, otherwise null should be passed- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
call
public ProcessInstance call(Process process, String recordID, Map<String,String> parameters, Boolean doCommit)
Calls a process. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
process
- the process to executerecordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parameters, supports only string parameters, for support of other parameters see the next method:callProcess(org.openbravo.model.ad.ui.Process, String, Map)
doCommit
- do commit at the end of the procedure only if calledFromApp functionality is supported in the procedure, otherwise null should be passed- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
callProcess
public ProcessInstance callProcess(Process process, String recordID, Map<String,?> parameters, Boolean doCommit)
Calls a process. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
process
- the process to executerecordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parametersdoCommit
- do commit at the end of the procedure only if calledFromApp functionality is supported in the procedure, otherwise null should be passed- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
call
public ProcessInstance call(String processName, String recordID, Map<String,String> parameters)
Calls a process with the specified name. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
processName
- the name of the stored procedure, must exist in the database, seeProcess.getProcedure()
.recordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parameters- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
call
public ProcessInstance call(Process process, String recordID, Map<String,String> parameters)
Calls a process. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
process
- the process to executerecordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parameters, supports only string parameters, for support of other parameters see the next method:callProcess(org.openbravo.model.ad.ui.Process, String, Map)
- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
callProcess
public ProcessInstance callProcess(Process process, String recordID, Map<String,?> parameters)
Calls a process. The recordID and parameters can be null. Parameters are translated intoParameter
instances.- Parameters:
process
- the process to executerecordID
- the recordID will be set in theProcessInstance
, seeProcessInstance.getRecordID()
parameters
- are translated into process parameters- Returns:
- the created instance with the result (
ProcessInstance.getResult()
) or error (ProcessInstance.getErrorMsg()
)
-
-