コード例 #1
0
ファイル: WfProcess.cs プロジェクト: jerryshi2007/AK47Source
 /// <summary>
 /// 准备下一步的Assignees
 /// </summary>
 /// <param name="nextActivity"></param>
 /// <param name="transferParams"></param>
 private void PrepareActivityAssigneesFromTransferParams(WfActivityBase nextActivity, WfTransferParams transferParams)
 {
     nextActivity.Assignees.Clear();
     nextActivity.Assignees.CopyFrom(transferParams.Assignees);
     nextActivity.Assignees.CopyFrom(GetDelegatedAssignees(transferParams.Assignees, this));
     nextActivity.Assignees.Distinct((a1, a2) => string.Compare(a1.User.ID, a2.User.ID, true) == 0 && a1.AssigneeType == a2.AssigneeType);
 }
コード例 #2
0
ファイル: WfProcess.cs プロジェクト: jerryshi2007/AK47Source
 /// <summary>
 /// 将Activity中的Assignees填充到Acl中
 /// </summary>
 /// <param name="resourceID"></param>
 /// <param name="nextActivity"></param>
 private static void FillAclInContext(string resourceID, WfActivityBase nextActivity)
 {
     if (resourceID.IsNotEmpty())
     {
         WfAclItemCollection acl = nextActivity.Assignees.ToAcl(resourceID, nextActivity.ID);
         WfRuntime.ProcessContext.Acl.CopyFrom(acl);
     }
 }
コード例 #3
0
ファイル: WfProcess.cs プロジェクト: jerryshi2007/AK47Source
        /// <summary>
        /// 流转时,设置目标节点的状态,包括启动分支流程等操作。
        /// </summary>
        /// <param name="nextActivity"></param>
        /// <param name="transferParams"></param>
        private void ExecuteNextActivityActionsAndSetStatus(WfActivityBase nextActivity, WfTransferParams transferParams)
        {
            PrepareActivityAssigneesFromTransferParams(nextActivity, transferParams);

            CalculateActivityCompleteTime(nextActivity.Descriptor);

            FillAclInContext(this.SearchID, nextActivity);

            //启动分支流程
            transferParams.BranchTransferParams.ForEach(b => nextActivity.StartupBranchProcesses(b));

            if (transferParams.BranchTransferParams.Count == 0 &&
                    WfRuntime.ProcessContext.TargetActivityCanMoveTo &&
                    nextActivity.Descriptor.IsConditionActivity == false)
            {
                nextActivity.Status = WfActivityStatus.Running;
            }
            else
            {
                nextActivity.Status = WfActivityStatus.Pending;
            }

            WfRuntime.ProcessContext.ResetContextByProcess(this);
            RegisterAndPrepareActions(nextActivity.EnterActions);

            if (nextActivity.Descriptor.ActivityType == WfActivityType.CompletedActivity)
            {
                nextActivity.Status = WfActivityStatus.Completed;

                this.Status = WfProcessStatus.Completed;
                this.EndTime = DateTime.Now;

                WfRuntime.ProcessContext.ResetContextByProcess(this);

                this._ElapsedActivities.Add(nextActivity);

                RegisterAndPrepareActions(nextActivity.LeaveActions);
                RegisterAndPrepareActions(this.CompleteProcessActions);

                ExecuteNextSerialProcess(this.EntryInfo);
            }

            SyncUrlsInAssigneesFromTasks(nextActivity, WfRuntime.ProcessContext.MoveToUserTasks);

            this.ProcessPendingActivity();
        }