Example #1
0
 public VicePresident(IApprover next)
     : base(next)
 {
     _next = next;
 }
Example #2
0
 public Worker(int threshold, IApprover next = null)
 {
     Threshold    = threshold;
     NextApprover = next;
 }
Example #3
0
 public static void Approve(IApprover adminUser, Employee employee)
 {
     adminUser.ApproveTimeOffRequest(employee, 3);
 }
Example #4
0
 public IApprover CreateLink(IApprover currentApprover, IApprover nextApprover)
 {
     return(beethovenFactory.Generate <IApprover>(
                new ApproverLink(currentApprover, nextApprover)
                ));
 }
Example #5
0
 public void SetSuccessor(IApprover approver)
 {
     _approver = approver;
 }
        /// <summary>
        /// 创建工作流实例的工厂方法(新流程)
        /// </summary>
        /// <param name="template"></param>
        /// <param name="form"></param>
        /// <param name="owner"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public static IWorkflowInstance Create(IWorkflowTemplate template, IForm form, IApprover owner, WorkflowExecutionContext context)
        {
            //新建第一个activity实例,流程owner进行提交
            var instance         = new WorkflowInstance(template, form, owner, context);
            var activityInstance = new ActivityInstance
            {
                ActivityTemplate = template.Activities.First(),
                CreatedOn        = DateTime.Now,
                LastUpdatedOn    = DateTime.Now,
            };

            instance.Current = activityInstance;
            return(instance);
        }
Example #7
0
 public SeniorManager(int threshold, IApprover next = null)
 {
     Threshold    = threshold;
     NextApprover = next;
 }
Example #8
0
        public static void NotifyApprove(this IApprover approver, double amount)
        {
            string _ = "";

            approver.Approve(amount, ref _);
        }
Example #9
0
 public ApproverLink(IApprover current, IApprover next)
 {
     this.current = current;
     this.next    = next;
 }