/** * ************************************************************************ Start Workflow. * * @param AD_Workflow_ID workflow * @return true if started */ private boolean startWorkflow(int AD_Workflow_ID) { log.fine(AD_Workflow_ID + " - " + m_pi); boolean started = false; if (DB.isRemoteProcess()) { log.info("trying to running on the server"); Server server = CConnection.get().getServer(); try { if (server != null) { // See ServerBean log.info("running on the server"); m_pi = server.workflow(m_wscctx, m_pi, AD_Workflow_ID); log.finest("server => " + m_pi); started = true; } } catch (Exception ex) { log.log(Level.SEVERE, "AppsServer error", ex); started = false; } } // Run locally if (!started && !m_IsServerProcess) { log.info("running locally"); MWorkflow wf = MWorkflow.get(m_wscctx, AD_Workflow_ID); MWFProcess wfProcess = null; if (m_pi.isBatch()) wfProcess = wf.start(m_pi); // may return null else wfProcess = wf.startWait(m_pi); // may return null started = wfProcess != null; } return started; } // startWorkflow