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();
}
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();
}
//
//
}
Aggregations