Пример #1
0
        /// <summary>
        /// 加载模板,并初始化流程
        /// </summary>
        /// <param name="template">模板名称</param>
        /// <param name="flowAttachment">流程附属数据</param>
        /// <returns></returns>
        public FlowEngine TemplateLoad(string template, FlowAttachment flowAttachment)
        {
            string     file       = this.GetTemplateFile(template);
            FlowEngine flowEngine = FlowEngine.Load(file);

            flowEngine.ResetIdentity();
            flowEngine.Reset(flowAttachment);
            return(flowEngine);
        }
Пример #2
0
        /// <summary>
        /// 加载模板
        /// </summary>
        /// <param name="template"></param>
        /// <returns></returns>
        public FlowEngine TemplateLoad(string template)
        {
            string     file       = this.GetTemplateFile(template);
            FlowEngine flowEngine = FlowEngine.Load(file);

            flowEngine.FinishedHandler -= new FlowEngine.FinishedEventHandler(FlowManager.FlowFinished);
            flowEngine.FinishedHandler += new FlowEngine.FinishedEventHandler(FlowManager.FlowFinished);
            flowEngine.FlowState        = FlowState.SelfWaiting;
            flowEngine.ResetIdentity();
            return(flowEngine);
        }
Пример #3
0
        /// <summary>
        /// 加载流程文件
        /// </summary>
        /// <param name="category">分类</param>
        /// <param name="owner">属主</param>
        /// <returns></returns>
        public FlowEngine Load(int owner)
        {
            FlowKey flowKey = new FlowKey()
            {
                Owner = owner
            };

            if (this.dicFlow.ContainsKey(flowKey))
            {
                return(this.dicFlow[flowKey]);
            }
            string     fileName   = FlowManager.GetFlowFile(owner);
            FlowEngine flowEngine = FlowEngine.Load(fileName);

            flowEngine.FinishedHandler -= new FlowEngine.FinishedEventHandler(FlowManager.FlowFinished);
            flowEngine.FinishedHandler += new FlowEngine.FinishedEventHandler(FlowManager.FlowFinished);
            if (flowEngine.FlowState != FlowState.Finished && !this.dicFlow.ContainsKey(flowKey))
            {
                this.dicFlow.Add(flowKey, flowEngine);
            }
            return(flowEngine);
        }