Search in sources :

Example 6 with MWFProcess

use of org.compiere.wf.MWFProcess in project adempiere by adempiere.

the class WorkflowTest method testQuery.

public void testQuery() throws Exception {
    //
    // Check MWFActivity
    int AD_Table_ID = MRequisition.Table_ID;
    // dummy;
    int Record_ID = 1;
    MWFActivity.get(getCtx(), AD_Table_ID, Record_ID, false);
    MWFActivity.get(getCtx(), AD_Table_ID, Record_ID, true);
    //
    // Check MWFEventAudit
    // dummy
    int AD_WF_Process_ID = 1;
    // dummy
    int AD_WF_Node_ID = 1;
    MWFEventAudit.get(getCtx(), AD_WF_Process_ID, AD_WF_Node_ID, getTrxName());
    MWFEventAudit.get(getCtx(), AD_WF_Process_ID, getTrxName());
    //
    // Check MWFProcess 
    MWFProcess proc = new Query(getCtx(), MWFProcess.Table_Name, null, getTrxName()).setClient_ID().setOrderBy(MWFProcess.COLUMNNAME_AD_WF_Process_ID).first();
    if (proc != null) {
        proc.getActivities(true, false, getTrxName());
        proc.getActivities(true, true, getTrxName());
    } else {
    // TODO: check MWFProcess - need better test
    }
    //
    // Check MWorkflow, MWFNode, MWFNodeNext etc
    int AD_Client_ID = getAD_Client_ID();
    // Process_Requisition
    int AD_Workflow_ID = 115;
    MWorkflow wf = MWorkflow.get(getCtx(), AD_Workflow_ID);
    for (MWFNode node : wf.getNodes(false, AD_Client_ID)) {
        MWFNodePara.getParameters(node.getCtx(), node.getAD_WF_Node_ID());
        for (MWFNodeNext next : node.getTransitions(AD_Client_ID)) {
            next.getConditions(true);
            next.getConditions(false);
        }
    }
    // Check MWorkflowProcessor
    for (MWorkflowProcessor processor : MWorkflowProcessor.getActive(getCtx())) {
        processor.getLogs();
    }
//
//
}
Also used : MWFProcess(org.compiere.wf.MWFProcess) Query(org.compiere.model.Query) MWorkflow(org.compiere.wf.MWorkflow) MWFNode(org.compiere.wf.MWFNode) MWFNodeNext(org.compiere.wf.MWFNodeNext) MWorkflowProcessor(org.compiere.wf.MWorkflowProcessor)

Aggregations

MWFProcess (org.compiere.wf.MWFProcess)6 MWorkflow (org.compiere.wf.MWorkflow)3 File (java.io.File)2 InvalidClassException (java.io.InvalidClassException)2 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)2 Server (org.compiere.interfaces.Server)2 PO (org.compiere.model.PO)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 CharArrayWriter (java.io.CharArrayWriter)1 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 JasperPrint (net.sf.jasperreports.engine.JasperPrint)1 MPInstance (org.compiere.model.MPInstance)1 MProcess (org.compiere.model.MProcess)1 MTable (org.compiere.model.MTable)1 Query (org.compiere.model.Query)1 MPrintFormat (org.compiere.print.MPrintFormat)1 ReportEngine (org.compiere.print.ReportEngine)1 DocAction (org.compiere.process.DocAction)1