/// <summary> /// 重置数据 /// </summary> public void Reset(FlowAttachment flowAttachment) { foreach (var node in this.nodes) { node.Reset(flowAttachment); } }
public void Reset(FlowAttachment flowAttachment) { if (this.Category == 1 && this.Department == -1 && this.Actor != null) { this.Department = this.Actor.Find(flowAttachment, this); } }
public override void Reset(FlowAttachment flowAttachment) { base.Reset(flowAttachment); if (this.Condition == null || this.AuditType != WorkFlowEngine.AuditType.UnAudit) { return; } if (this.Expect != this.Condition.FindExpect(flowAttachment)) { this.conclusion.AuditType = WorkFlowEngine.AuditType.Disable; } }
/// <summary> /// 创建流程实例(不保存入库) /// </summary> /// <param name="id">编号</param> /// <param name="category">分类</param> /// <param name="uid">创建人</param> /// <param name="depLevel1">中心及职能部门</param> /// <param name="depLevel2">中心下属部门</param> /// <returns>流程实例</returns> public static FlowEngine Build(ProjectEntity projectEntity, FlowKinkEntity flowKinkEntity, int userId) { //获取当前模板 FlowAttachment flowAttachment = new FlowAttachment() { Owner = projectEntity.Id, Kind = flowKinkEntity.id }; flowAttachment.Creater = userId; FlowManager flowMgr = FlowManager.Instance(); FlowEngine flowEngine = flowMgr.TemplateLoad(flowKinkEntity.C_Template); flowEngine.Attachment = flowAttachment; FlowHelper.Concat(flowAttachment.Owner, flowEngine); 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); }
/// <summary> /// reset Guid from template loaded /// </summary> /// <param name="owner">流程属主</param> public void Reset(FlowAttachment flowAttachment) { this.attachment = flowAttachment; this.Reset(); }
/// <summary> /// 重置节点数据 /// </summary> /// <param name="flowEngine">流程</param> public virtual void Reset(FlowAttachment flowAttachment) { this.participant.Reset(flowAttachment); }
/// <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; }