use of org.compiere.model.X_ASP_Process_Para in project adempiere by adempiere.
the class ASPGenerateFields method generateProcess.
// doIt
private void generateProcess(int p_AD_Process_ID) {
// Add Process and Parameters
MProcess process = new MProcess(getCtx(), p_AD_Process_ID, get_TrxName());
int asp_process_id = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM ASP_Process WHERE ASP_Level_ID = ? AND AD_Process_ID = ?", p_ASP_Level_ID, process.getAD_Process_ID());
X_ASP_Process aspProcess = null;
if (asp_process_id < 1) {
aspProcess = new X_ASP_Process(getCtx(), 0, get_TrxName());
aspProcess.setASP_Level_ID(p_ASP_Level_ID);
aspProcess.setAD_Process_ID(process.getAD_Process_ID());
aspProcess.setASP_Status(p_ASP_Status);
if (aspProcess.save()) {
noProcesses++;
asp_process_id = aspProcess.getASP_Process_ID();
}
} else {
aspProcess = new X_ASP_Process(getCtx(), asp_process_id, get_TrxName());
}
// parameters
for (MProcessPara processpara : process.getParameters()) {
if (DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM ASP_Process_Para WHERE ASP_Process_ID = ? AND AD_Process_Para_ID = ?", asp_process_id, processpara.getAD_Process_Para_ID()) < 1) {
X_ASP_Process_Para aspProcess_Para = new X_ASP_Process_Para(getCtx(), 0, get_TrxName());
aspProcess_Para.setASP_Process_ID(asp_process_id);
aspProcess_Para.setAD_Process_Para_ID(processpara.getAD_Process_Para_ID());
aspProcess_Para.setASP_Status(p_ASP_Status);
if (aspProcess_Para.save())
noParameters++;
}
}
if (process.getAD_Workflow_ID() > 0) {
generateWorkflow(process.getAD_Workflow_ID());
}
}
use of org.compiere.model.X_ASP_Process_Para in project adempiere by adempiere.
the class ASPGenerateLevel method generateProcess.
private void generateProcess(int p_AD_Process_ID) {
// Add Process and Parameters
MProcess process = new MProcess(getCtx(), p_AD_Process_ID, get_TrxName());
int asp_process_id = DB.getSQLValueEx(get_TrxName(), "SELECT ASP_Process_ID FROM ASP_Process WHERE ASP_Level_ID = ? AND AD_Process_ID = ?", p_ASP_Level_ID, process.getAD_Process_ID());
X_ASP_Process aspProcess = null;
if (asp_process_id < 1) {
aspProcess = new X_ASP_Process(getCtx(), 0, get_TrxName());
aspProcess.setASP_Level_ID(p_ASP_Level_ID);
aspProcess.setAD_Process_ID(process.getAD_Process_ID());
aspProcess.setASP_Status(p_ASP_Status);
if (aspProcess.save()) {
noProcesses++;
asp_process_id = aspProcess.getASP_Process_ID();
}
} else {
aspProcess = new X_ASP_Process(getCtx(), asp_process_id, get_TrxName());
}
// parameters
for (MProcessPara processpara : process.getParameters()) {
if (DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM ASP_Process_Para WHERE ASP_Process_ID = ? AND AD_Process_Para_ID = ?", asp_process_id, processpara.getAD_Process_Para_ID()) < 1) {
X_ASP_Process_Para aspProcess_Para = new X_ASP_Process_Para(getCtx(), 0, get_TrxName());
aspProcess_Para.setASP_Process_ID(asp_process_id);
aspProcess_Para.setAD_Process_Para_ID(processpara.getAD_Process_Para_ID());
aspProcess_Para.setASP_Status(p_ASP_Status);
if (aspProcess_Para.save())
noParameters++;
}
}
if (process.getAD_Workflow_ID() > 0) {
generateWorkflow(process.getAD_Workflow_ID());
}
}
Aggregations