/// <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); }
/// <summary> /// 普通节点设置IActor /// 条件节点设置ICondition /// </summary> /// <param name="flowEngine">流程对象</param> public void Assign(FlowEngine flowEngine, FlowAttachment flowAttachment) { foreach (var step in flowEngine.FlowSteps) { foreach (var node in step.Nodes) { //node.Participant.Actor = new DepartmentActor(); if (node is NodeCondition) { ((NodeCondition)node).Condition = new RevenuCondition(); } } } flowEngine.Reset(flowAttachment); }