Exemplo n.º 1
0
        /// <summary>
        /// Start Workflow.
        /// </summary>
        /// <param name="AD_Workflow_ID">AD_Workflow_ID </param>
        /// <returns>true if started</returns>
        private bool StartWorkflow(int AD_Workflow_ID)
        {
            //Remote process not implemented
            //Only local process is implemented
            //log.Fine(AD_Workflow_ID + " - " + _pi.ToString());
            bool started = false;

            //	Run locally
            if (!started)
            {
                MWorkflow  WF        = new MWorkflow(_ctx, AD_Workflow_ID, null);
                MWFProcess wfProcess = null;
                if (_pi.IsBatch())
                {
                    wfProcess = WF.Start(_pi);          //	may return null
                }
                else
                {
                    wfProcess = WF.StartWait(_pi);      //	may return null
                }
                started = wfProcess != null;
            }

            return(started);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Run Workflow (and wait) on Server
        /// @ejb.interface-method view-type="both"
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="pi"></param>
        /// <param name="AD_Workflow_ID"></param>
        /// <returns></returns>
        public ProcessInfo Workflow(Ctx ctx, ProcessInfo pi, int AD_Workflow_ID)
        {
            log.Info("[" + _no + "] " + AD_Workflow_ID);
            _workflowCount++;
            MWorkflow  wf        = MWorkflow.Get(ctx, AD_Workflow_ID);
            MWFProcess wfProcess = null;

            if (pi.IsBatch())
            {
                wfProcess = wf.Start(pi);       //	may return null
            }
            else
            {
                wfProcess = wf.StartWait(pi);   //	may return null
            }
            log.Fine(pi.ToString());
            return(pi);
        }