/// <summary>
        /// 创建一个包含了作废流程任务的任务流程活动
        /// </summary>
        /// <param name="sysTaskProcess"></param>
        /// <param name="processID"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static SysTaskActivity CreateCancelProcessActivity(this SysTaskProcess sysTaskProcess, string processID, int index)
        {
            CancelProcessTask task = CancelProcessTask.CreateTask(processID, false);

            SysTaskActivity activity = WfSysTaskActivityHelper.CreateActivity(
                sysTaskProcess,
                index,
                string.Format("作废ID为{0}的流程的任务流程活动",
                              processID, index), task);

            SysTaskProcessRuntime.ProcessContext.AffectedActivities.AddOrReplace(activity);

            return(activity);
        }
Example #2
0
        private SysTaskActivity CreateUserActivity(SysTaskProcess sysTaskProcess, int index, IEnumerable <IUser> users)
        {
            SysTask task = CreateUserTaskInActivity(users);

            SysTaskActivity activity = WfSysTaskActivityHelper.CreateActivity(
                sysTaskProcess,
                index,
                string.Format("创建活动{0}的分支流程的任务流程活动{1}",
                              this.OwnerActivityID, index), task);

            SysTaskProcessRuntime.ProcessContext.AffectedActivities.AddOrReplace(activity);

            return(activity);
        }
        /// <summary>
        /// 创建一个包含了撤回流程任务的任务流程活动
        /// </summary>
        /// <param name="sysTaskProcess"></param>
        /// <param name="processID"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static SysTaskActivity CreateWithdrawProcessActivity(this SysTaskProcess sysTaskProcess, string processID, int index)
        {
            string activityID = UuidHelper.NewUuidString();

            WithdrawProcessTask task = WithdrawProcessTask.CreateTask(processID, false);

            SysTaskActivity activity = WfSysTaskActivityHelper.CreateActivity(
                sysTaskProcess,
                index,
                string.Format("撤回ID为{0}的流程的任务流程活动",
                              processID, index), task);

            SysTaskProcessRuntime.ProcessContext.AffectedActivities.AddOrReplace(activity);

            return(activity);
        }
        /// <summary>
        /// 创建一个分发作废流程任务流程的任务活动
        /// </summary>
        /// <param name="sysTaskProcess"></param>
        /// <param name="ownerActivityID"></param>
        /// <param name="cancelAllBranchProcesses"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static SysTaskActivity CreateDispatchCancelBranchesProcessActivity(this SysTaskProcess sysTaskProcess, string ownerActivityID, bool cancelAllBranchProcesses, int index)
        {
            string activityID = UuidHelper.NewUuidString();

            DispatchCancelBranchProcessesTask task = DispatchCancelBranchProcessesTask.CreateTask(activityID, ownerActivityID, cancelAllBranchProcesses);

            SysTaskActivity activity = WfSysTaskActivityHelper.CreateActivity(
                sysTaskProcess,
                index,
                string.Format("分派作废活动ID为{0}的分支流程的任务流程活动", ownerActivityID, index),
                task);

            activity.ID = activityID;

            SysTaskProcessRuntime.ProcessContext.AffectedActivities.AddOrReplace(activity);

            return(activity);
        }