Beispiel #1
0
        /// <summary>
        /// 执行方法流
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btAction_Click(object sender, EventArgs e)
        {
            if (null == _methodFlow)
            {
                MessageBox.Show("无效操作!动作流对象未设置");
                return;
            }
            if (0 == _methodFlow.Count)
            {
                MessageBox.Show("无效操作!动作流中没有方法节点");
                return;
            }
            JFWorkCmdResult ret = JFWorkCmdResult.UnknownError;

            if (_methodFlow.CurrWorkStatus == JFWorkStatus.Pausing)
            {
                ret = _methodFlow.Resume(2000);
                if (ret != JFWorkCmdResult.Success)
                {
                    MessageBox.Show("恢复运行失败,错误代码 = " + ret);
                    return;
                }
                ShowTips("已恢复运行");
                return;
            }

            if (_methodFlow.CurrWorkStatus == JFWorkStatus.Running ||
                _methodFlow.CurrWorkStatus == JFWorkStatus.Interactiving)//当前正在运行
            {
                ShowTips("无效操作,工作流正在运行");
                return;
            }
            UpdatePoolValues();
            ret = _methodFlow.Start();
            if (ret != JFWorkCmdResult.Success)
            {
                MessageBox.Show(" 启动工作流失败,错误代码:" + ret);
                return;
            }
        }