Search in sources :

Example 1 with X_ASP_Process_Para

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());
    }
}
Also used : MProcess(org.compiere.model.MProcess) X_ASP_Process(org.compiere.model.X_ASP_Process) MProcessPara(org.compiere.model.MProcessPara) X_ASP_Process_Para(org.compiere.model.X_ASP_Process_Para)

Example 2 with X_ASP_Process_Para

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());
    }
}
Also used : MProcess(org.compiere.model.MProcess) X_ASP_Process(org.compiere.model.X_ASP_Process) MProcessPara(org.compiere.model.MProcessPara) X_ASP_Process_Para(org.compiere.model.X_ASP_Process_Para)

Aggregations

MProcess (org.compiere.model.MProcess)2 MProcessPara (org.compiere.model.MProcessPara)2 X_ASP_Process (org.compiere.model.X_ASP_Process)2 X_ASP_Process_Para (org.compiere.model.X_ASP_Process_Para)2