Search in sources :

Example 1 with MWorkflowProcessor

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

the class AdempiereServerMgr method startServers.

//	startEnvironment
/**
	 * 	Start Environment
	 *	@return true if started
	 */
private boolean startServers() {
    log.info("");
    int noServers = 0;
    //	Accounting
    MAcctProcessor[] acctModels = MAcctProcessor.getActive(m_ctx);
    for (int i = 0; i < acctModels.length; i++) {
        MAcctProcessor pModel = acctModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Request
    MRequestProcessor[] requestModels = MRequestProcessor.getActive(m_ctx);
    for (int i = 0; i < requestModels.length; i++) {
        MRequestProcessor pModel = requestModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Workflow
    MWorkflowProcessor[] workflowModels = MWorkflowProcessor.getActive(m_ctx);
    for (int i = 0; i < workflowModels.length; i++) {
        MWorkflowProcessor pModel = workflowModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Alert
    MAlertProcessor[] alertModels = MAlertProcessor.getActive(m_ctx);
    for (int i = 0; i < alertModels.length; i++) {
        MAlertProcessor pModel = alertModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	Scheduler
    MScheduler[] schedulerModels = MScheduler.getActive(m_ctx);
    for (int i = 0; i < schedulerModels.length; i++) {
        MScheduler pModel = schedulerModels[i];
        AdempiereServer server = AdempiereServer.create(pModel);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 2);
        m_servers.add(server);
    }
    //	LDAP
    MLdapProcessor[] ldapModels = MLdapProcessor.getActive(m_ctx);
    for (int i = 0; i < ldapModels.length; i++) {
        MLdapProcessor lp = ldapModels[i];
        AdempiereServer server = AdempiereServer.create(lp);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 1);
        m_servers.add(server);
    }
    //	ImportProcessor - @Trifon
    MIMPProcessor[] importModels = MIMPProcessor.getActive(m_ctx);
    for (int i = 0; i < importModels.length; i++) {
        MIMPProcessor lp = importModels[i];
        AdempiereServer server = AdempiereServer.create(lp);
        server.start();
        server.setPriority(Thread.NORM_PRIORITY - 1);
        m_servers.add(server);
    }
    log.fine("#" + noServers);
    return startAll();
}
Also used : MRequestProcessor(org.compiere.model.MRequestProcessor) MLdapProcessor(org.compiere.model.MLdapProcessor) MAcctProcessor(org.compiere.model.MAcctProcessor) MIMPProcessor(org.compiere.model.MIMPProcessor) MWorkflowProcessor(org.compiere.wf.MWorkflowProcessor) MScheduler(org.compiere.model.MScheduler) MAlertProcessor(org.compiere.model.MAlertProcessor)

Example 2 with MWorkflowProcessor

use of org.compiere.wf.MWorkflowProcessor 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

MWorkflowProcessor (org.compiere.wf.MWorkflowProcessor)2 MAcctProcessor (org.compiere.model.MAcctProcessor)1 MAlertProcessor (org.compiere.model.MAlertProcessor)1 MIMPProcessor (org.compiere.model.MIMPProcessor)1 MLdapProcessor (org.compiere.model.MLdapProcessor)1 MRequestProcessor (org.compiere.model.MRequestProcessor)1 MScheduler (org.compiere.model.MScheduler)1 Query (org.compiere.model.Query)1 MWFNode (org.compiere.wf.MWFNode)1 MWFNodeNext (org.compiere.wf.MWFNodeNext)1 MWFProcess (org.compiere.wf.MWFProcess)1 MWorkflow (org.compiere.wf.MWorkflow)1