Exemplo n.º 1
0
        /// <summary>
        /// 流程返签,先检查约束条件,然后调用wfruntimeinstance执行
        /// </summary>
        /// <param name="runner">执行者</param>
        /// <param name="result">结果对象</param>
        /// <returns>运行时实例对象</returns>
        public static WfRuntimeManager CreateRuntimeInstanceReverse(WfAppRunner runner,
                                                                    ref WfExecutedResult result)
        {
            var rmins = new WfRuntimeManagerReverse();

            rmins.WfExecutedResult = result = new WfExecutedResult();
            var pim             = new ProcessInstanceManager();
            var processInstance = pim.GetProcessInstanceLatest(runner.AppInstanceID, runner.ProcessGUID);

            if (processInstance == null || processInstance.ProcessState != (short)ProcessStateEnum.Completed)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Reverse_NotInCompleted;
                result.Message       = string.Format("当前应用:{0},实例ID:{1}, 没有完成的流程实例,无法让流程重新运行!",
                                                     runner.AppName, runner.AppInstanceID);
                return(rmins);
            }

            var tim = new TransitionInstanceManager();
            var endTransitionInstance = tim.GetEndTransition(runner.AppName, runner.AppInstanceID, runner.ProcessGUID);

            var processModel = ProcessModelFactory.Create(processInstance.ProcessGUID, processInstance.Version);
            var endActivity  = processModel.GetActivity(endTransitionInstance.ToActivityGUID);

            var aim = new ActivityInstanceManager();
            var endActivityInstance = aim.GetById(endTransitionInstance.ToActivityInstanceID);

            bool hasGatewayNode           = false;
            var  lastTaskActivityInstance = tim.GetPreviousActivityInstance(endActivityInstance, false,
                                                                            out hasGatewayNode).ToList()[0];
            var lastTaskActivity = processModel.GetActivity(lastTaskActivityInstance.ActivityGUID);

            //封装返签结束点之前办理节点的任务接收人
            rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(lastTaskActivityInstance.ActivityGUID,
                                                                                                   lastTaskActivityInstance.EndedByUserID,
                                                                                                   lastTaskActivityInstance.EndedByUserName);

            rmins.ActivityResource        = new ActivityResource(runner, rmins.AppRunner.NextActivityPerformers);
            rmins.AppRunner.AppName       = runner.AppName;
            rmins.AppRunner.AppInstanceID = runner.AppInstanceID;
            rmins.AppRunner.ProcessGUID   = runner.ProcessGUID;
            rmins.AppRunner.UserID        = runner.UserID;
            rmins.AppRunner.UserName      = runner.UserName;

            rmins.BackwardContext.ProcessInstance                = processInstance;
            rmins.BackwardContext.BackwardToTaskActivity         = lastTaskActivity;
            rmins.BackwardContext.BackwardToTaskActivityInstance = lastTaskActivityInstance;
            rmins.BackwardContext.BackwardToTargetTransitionGUID =
                hasGatewayNode == false ? endTransitionInstance.TransitionGUID : String.Empty;
            rmins.BackwardContext.BackwardFromActivity         = endActivity;
            rmins.BackwardContext.BackwardFromActivityInstance = endActivityInstance;
            rmins.BackwardContext.BackwardTaskReceiver         = WfBackwardTaskReceiver.Instance(lastTaskActivityInstance.ActivityName,
                                                                                                 lastTaskActivityInstance.EndedByUserID,
                                                                                                 lastTaskActivityInstance.EndedByUserName);

            return(rmins);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据不同退回场景创建运行时管理器
        /// </summary>
        /// <param name="runningActivityInstanceList">运行节点列表</param>
        /// <param name="sendbackOperation">退回类型</param>
        /// <param name="runner">执行者</param>
        /// <param name="result">结果对象</param>
        /// <returns>运行时管理器</returns>
        private static WfRuntimeManager CreateRuntimeInstanceSendbackByCase(
            List <ActivityInstanceEntity> runningActivityInstanceList,
            SendbackOperationTypeEnum sendbackOperation,
            WfAppRunner runner,
            ref WfExecutedResult result)
        {
            WfRuntimeManager rmins = new WfRuntimeManagerSendBack();

            rmins.WfExecutedResult = result = new WfExecutedResult();

            ActivityInstanceEntity runningNode = runningActivityInstanceList.Where(x => x.ActivityState == (int)ActivityStateEnum.Running).OrderBy(x => x.ID).FirstOrDefault();

            if (runningNode == null)
            {
                runningNode = runningActivityInstanceList[0];
            }
            ProcessInstanceEntity processInstance = (new ProcessInstanceManager()).GetById(runningNode.ProcessInstanceID);
            IProcessModel         processModel    = ProcessModelFactory.Create(processInstance.ProcessGUID, processInstance.Version);

            var aim = new ActivityInstanceManager();

            //以下处理,需要知道上一步是独立节点的信息
            //获取上一步流转节点信息,可能经过And, Or等路由节点
            var  tim            = new TransitionInstanceManager();
            bool hasGatewayNode = false;
            var  currentNode    = runningNode;

            var lastActivityInstanceList = tim.GetPreviousActivityInstance(currentNode, true, out hasGatewayNode).ToList();

            if (lastActivityInstanceList == null || lastActivityInstanceList.Count == 0 || lastActivityInstanceList.Count > 1)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Sendback_NullOrHasTooMany;
                result.Message       = "当前没有可以退回的节点,或者有多个可以退回的节点,无法选择!";

                return(rmins);
            }

            TransitionInstanceEntity lastTaskTransitionInstance = tim.GetLastTaskTransition(runner.AppName,
                                                                                            runner.AppInstanceID, runner.ProcessGUID);

            if (lastTaskTransitionInstance.TransitionType == (short)TransitionTypeEnum.Loop)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Sendback_IsLoopNode;
                result.Message       = "当前流转是自循环,无需退回!";

                return(rmins);
            }

            //设置退回节点的相关信息
            var previousActivityInstance = lastActivityInstanceList[0];

            if (previousActivityInstance.ActivityType == (short)ActivityTypeEnum.StartNode)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Sendback_PreviousIsStartNode;
                result.Message       = "上一步是开始节点,无需退回!";

                return(rmins);
            }

            if (sendbackOperation == SendbackOperationTypeEnum.Normal)
            {
                //简单串行模式下的退回
                rmins = new WfRuntimeManagerSendBack();
                rmins.WfExecutedResult = result = new WfExecutedResult();

                rmins.ProcessModel = processModel;
                rmins.BackwardContext.ProcessInstance                = processInstance;
                rmins.BackwardContext.BackwardToTaskActivity         = processModel.GetActivity(previousActivityInstance.ActivityGUID);
                rmins.BackwardContext.BackwardToTaskActivityInstance = previousActivityInstance;
                rmins.BackwardContext.BackwardToTargetTransitionGUID =
                    hasGatewayNode == false ? lastTaskTransitionInstance.TransitionGUID : String.Empty;        //如果中间有Gateway节点,则没有直接相连的TransitonGUID

                rmins.BackwardContext.BackwardFromActivity         = processModel.GetActivity(runningNode.ActivityGUID);
                rmins.BackwardContext.BackwardFromActivityInstance = runningNode;
                rmins.BackwardContext.BackwardTaskReceiver         = WfBackwardTaskReceiver.Instance(previousActivityInstance.ActivityName,
                                                                                                     previousActivityInstance.EndedByUserID, previousActivityInstance.EndedByUserName);

                //封装AppUser对象
                rmins.AppRunner.AppName                = runner.AppName;
                rmins.AppRunner.AppInstanceID          = runner.AppInstanceID;
                rmins.AppRunner.ProcessGUID            = runner.ProcessGUID;
                rmins.AppRunner.UserID                 = runner.UserID;
                rmins.AppRunner.UserName               = runner.UserName;
                rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(previousActivityInstance.ActivityGUID,
                                                                                                       previousActivityInstance.EndedByUserID,
                                                                                                       previousActivityInstance.EndedByUserName);
                rmins.ActivityResource = new ActivityResource(runner, rmins.AppRunner.NextActivityPerformers);

                return(rmins);
            }

            //如果有其它模式,没有处理到,则直接抛出异常
            throw new WorkflowException("未知的退回场景,请报告给技术支持人员!");
        }
Exemplo n.º 3
0
        private static WfRuntimeManager CreateRuntimeInstanceSendbackByCase(ActivityInstanceEntity runningNode,
                                                                            IProcessModel processModel,
                                                                            ProcessInstanceEntity processInstance,
                                                                            IList <ActivityEntity> sendbackPreviousActivityList,
                                                                            Boolean hasGatewayPassed,
                                                                            SendbackOperationTypeEnum sendbackOperation,
                                                                            WfAppRunner runner,
                                                                            ref WfExecutedResult result)
        {
            WfRuntimeManager rmins = new WfRuntimeManagerSendBack();

            rmins.WfExecutedResult = result = new WfExecutedResult();

            var aim = new ActivityInstanceManager();


            //以下处理,需要知道上一步是独立节点的信息
            var tim = new TransitionInstanceManager();
            TransitionInstanceEntity lastTaskTransitionInstance = tim.GetLastTaskTransition(runner.AppName,
                                                                                            runner.AppInstanceID, runner.ProcessGUID);

            if (lastTaskTransitionInstance.TransitionType == (short)TransitionTypeEnum.Loop)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Sendback_IsLoopNode;
                result.Message       = "当前流转是自循环,无需退回!";

                return(rmins);
            }

            //设置退回节点的相关信息
            var previousActivityGUID     = sendbackPreviousActivityList[0].ActivityGUID;
            var previousActivityInstance = aim.GetActivityInstanceLatest(runner.AppInstanceID, runner.ProcessGUID, previousActivityGUID);

            //普通模式的退回
            if (sendbackOperation == SendbackOperationTypeEnum.Normal)
            {
                //简单串行模式下的退回
                rmins = new WfRuntimeManagerSendBack();
                rmins.WfExecutedResult = result = new WfExecutedResult();

                rmins.ProcessModel = processModel;
                rmins.BackwardContext.ProcessInstance                = processInstance;
                rmins.BackwardContext.BackwardToTaskActivity         = processModel.GetActivity(previousActivityInstance.ActivityGUID);
                rmins.BackwardContext.BackwardToTaskActivityInstance = previousActivityInstance;
                rmins.BackwardContext.BackwardToTargetTransitionGUID =
                    hasGatewayPassed == false ? lastTaskTransitionInstance.TransitionGUID : WfDefine.WF_XPDL_GATEWAY_BYPASS_GUID;            //如果中间有Gateway节点,则没有直接相连的TransitonGUID

                rmins.BackwardContext.BackwardFromActivity         = processModel.GetActivity(runningNode.ActivityGUID);
                rmins.BackwardContext.BackwardFromActivityInstance = runningNode;
                rmins.BackwardContext.BackwardTaskReceiver         = WfBackwardTaskReceiver.Instance(previousActivityInstance.ActivityName,
                                                                                                     previousActivityInstance.EndedByUserID, previousActivityInstance.EndedByUserName);

                //封装AppUser对象
                rmins.AppRunner.AppName                = runner.AppName;
                rmins.AppRunner.AppInstanceID          = runner.AppInstanceID;
                rmins.AppRunner.ProcessGUID            = runner.ProcessGUID;
                rmins.AppRunner.UserID                 = runner.UserID;
                rmins.AppRunner.UserName               = runner.UserName;
                rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(previousActivityInstance.ActivityGUID,
                                                                                                       previousActivityInstance.EndedByUserID,
                                                                                                       previousActivityInstance.EndedByUserName);
                rmins.ActivityResource = new ActivityResource(runner, rmins.AppRunner.NextActivityPerformers);

                return(rmins);
            }

            //如果有其它模式,没有处理到,则直接抛出异常
            throw new WorkflowException("未知的退回场景,请报告给技术支持人员!");
        }
Exemplo n.º 4
0
        /// <summary>
        /// 根据不同撤销场景创建运行时管理器
        /// </summary>
        /// <param name="runningActivityInstanceList">运行节点列表</param>
        /// <param name="withdrawOperation">撤销类型</param>
        /// <param name="runner">执行者</param>
        /// <param name="result">结果对象</param>
        /// <returns>运行时管理器</returns>
        private static WfRuntimeManager CreateRuntimeInstanceWithdrawByCase(
            List <ActivityInstanceEntity> runningActivityInstanceList,
            WithdrawOperationTypeEnum withdrawOperation,
            WfAppRunner runner,
            ref WfExecutedResult result)
        {
            WfRuntimeManager rmins = new WfRuntimeManagerWithdraw();

            rmins.WfExecutedResult = result = new WfExecutedResult();

            //根据当前运行节点获取
            ActivityInstanceEntity runningNode     = runningActivityInstanceList[0];
            ProcessInstanceEntity  processInstance = (new ProcessInstanceManager()).GetById(runningNode.ProcessInstanceID);
            IProcessModel          processModel    = ProcessModelFactory.Create(processInstance.ProcessGUID, processInstance.Version);

            //不同撤销的分支场景处理
            var aim = new ActivityInstanceManager();

            //以下处理,需要知道上一步是独立节点的信息
            //获取上一步流转节点信息,可能经过And, Or等路由节点
            var  tim            = new TransitionInstanceManager();
            bool hasGatewayNode = false;
            var  currentNode    = runningNode;

            if (runningNode.MIHostActivityInstanceID != null)
            {
                //如果当前运行节点是多实例子节点,则需要找到它的主节点的Transiton记录
                currentNode = aim.GetById(runningNode.MIHostActivityInstanceID.Value);
            }
            var lastActivityInstanceList = tim.GetPreviousActivityInstance(currentNode, false, out hasGatewayNode).ToList();

            if (lastActivityInstanceList == null || lastActivityInstanceList.Count > 1)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Withdraw_HasTooMany;
                result.Message       = "当前没有可以撤销回去的节点,或者有多个可以撤销回去的节点,无法选择!";

                return(rmins);
            }

            TransitionInstanceEntity lastTaskTransitionInstance = null;

            if (hasGatewayNode == false)
            {
                lastTaskTransitionInstance = tim.GetLastTaskTransition(runner.AppName,
                                                                       runner.AppInstanceID, runner.ProcessGUID);
                if (lastTaskTransitionInstance.TransitionType == (short)TransitionTypeEnum.Loop)
                {
                    result.Status        = WfExecutedStatus.Exception;
                    result.ExceptionType = WfExceptionType.Withdraw_IsLoopNode;
                    result.Message       = "当前流转是自循环,无需撤销!";

                    return(rmins);
                }
            }

            var previousActivityInstance = lastActivityInstanceList[0];

            if (previousActivityInstance.EndedByUserID != runner.UserID)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Withdraw_NotCreatedByMine;
                result.Message       = string.Format("上一步节点的任务办理人跟当前登录用户不一致,无法撤销回上一步!节点办理人:{0}",
                                                     previousActivityInstance.EndedByUserName);

                return(rmins);
            }

            if (previousActivityInstance.ActivityType == (short)ActivityTypeEnum.EndNode)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Withdraw_PreviousIsEndNode;
                result.Message       = "上一步是结束节点,无法撤销!";

                return(rmins);
            }

            //当前运行节点是普通节点
            if (withdrawOperation == WithdrawOperationTypeEnum.Normal)
            {
                //简单串行模式下的退回
                rmins = new WfRuntimeManagerWithdraw();
                rmins.WfExecutedResult = result = new WfExecutedResult();

                rmins.ProcessModel                    = processModel;
                rmins.AppRunner.ProcessGUID           = runner.ProcessGUID;
                rmins.BackwardContext.ProcessInstance = processInstance;
                rmins.BackwardContext.BackwardToTargetTransitionGUID =
                    hasGatewayNode == false ? lastTaskTransitionInstance.TransitionGUID : String.Empty;
                rmins.BackwardContext.BackwardToTaskActivity         = processModel.GetActivity(previousActivityInstance.ActivityGUID);
                rmins.BackwardContext.BackwardToTaskActivityInstance = previousActivityInstance;
                rmins.BackwardContext.BackwardFromActivity           = processModel.GetActivity(runningNode.ActivityGUID);
                rmins.BackwardContext.BackwardFromActivityInstance   = runningNode; //准备状态的接收节点
                rmins.BackwardContext.BackwardTaskReceiver           = WfBackwardTaskReceiver.Instance(
                    previousActivityInstance.ActivityName,
                    previousActivityInstance.EndedByUserID,
                    previousActivityInstance.EndedByUserName);

                //封装AppUser对象
                rmins.AppRunner.AppName                = runner.AppName;
                rmins.AppRunner.AppInstanceID          = runner.AppInstanceID;
                rmins.AppRunner.UserID                 = runner.UserID;
                rmins.AppRunner.UserName               = runner.UserName;
                rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(
                    previousActivityInstance.ActivityGUID,
                    runner.UserID,
                    runner.UserName);
                rmins.ActivityResource = new ActivityResource(runner, rmins.AppRunner.NextActivityPerformers);

                return(rmins);
            }

            //如果有其它模式,没有处理到,则直接抛出异常
            throw new WorkflowException("未知的撤销场景,请报告给技术支持人员!");
        }
        /// <summary>
        /// 创建跳转实例信息
        /// </summary>
        /// <param name="runner">执行者</param>
        /// <param name="result">结果对象</param>
        /// <returns>运行时实例对象</returns>
        public static WfRuntimeManager CreateRuntimeInstanceJump(WfAppRunner runner,
                                                                 ref WfExecutedResult result)
        {
            var rmins = new WfRuntimeManagerJump();

            rmins.WfExecutedResult = result = new WfExecutedResult();

            if (string.IsNullOrEmpty(runner.AppName) ||
                String.IsNullOrEmpty(runner.AppInstanceID) ||
                runner.ProcessGUID == null ||
                runner.NextActivityPerformers == null)
            {
                //缺失方法参数
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Jump_ErrorArguments;
                result.Message       = LocalizeHelper.GetEngineMessage("wfruntimemanagerfactory.CreateRuntimeInstanceJump.missing.error");
                return(rmins);
            }

            //流程跳转时,只能跳转到一个节点
            if (runner.NextActivityPerformers.Count() > 1)
            {
                result.Status        = WfExecutedStatus.Exception;
                result.ExceptionType = WfExceptionType.Jump_OverOneStep;
                result.Message       = LocalizeHelper.GetEngineMessage("wfruntimemanagerfactory.CreateRuntimeInstanceJump.jump.error",
                                                                       runner.NextActivityPerformers.Count().ToString());
                return(rmins);
            }

            //获取当前运行节点信息
            var            aim         = new ActivityInstanceManager();
            TaskViewEntity taskView    = null;
            var            runningNode = aim.GetRunningNode(runner, out taskView);

            //传递runner变量
            rmins.TaskView                = taskView;
            rmins.AppRunner               = runner;
            rmins.AppRunner.AppName       = runner.AppName;
            rmins.AppRunner.AppInstanceID = runner.AppInstanceID;
            rmins.AppRunner.ProcessGUID   = runner.ProcessGUID;
            rmins.AppRunner.UserID        = runner.UserID;
            rmins.AppRunner.UserName      = runner.UserName;

            //用于流程注册时间调用时候的流程实例ID提供
            rmins.ProcessInstanceID = runningNode.ProcessInstanceID;

            var processModel = ProcessModelFactory.Create(taskView.ProcessGUID, taskView.Version);

            rmins.ProcessModel = processModel;

            #region 考虑回跳方式
            //获取跳转节点信息
            var jumpBackActivityGUID     = runner.NextActivityPerformers.First().Key;
            var jumpBackActivityInstance = aim.GetActivityInstanceLatest(runningNode.ProcessInstanceID, jumpBackActivityGUID);

            if (jumpBackActivityInstance != null)
            {
                //跳转到曾经执行过的节点上,可以作为跳回方式处理
                rmins.IsBackward = true;
                rmins.BackwardContext.ProcessInstance        = (new ProcessInstanceManager()).GetById(runningNode.ProcessInstanceID);
                rmins.BackwardContext.BackwardToTaskActivity = processModel.GetActivity(jumpBackActivityGUID);

                //获取当前运行节点的上一步节点
                bool hasGatewayNode             = false;
                var  tim                        = new TransitionInstanceManager();
                var  lastTaskTransitionInstance = tim.GetLastTaskTransition(runner.AppName,
                                                                            runner.AppInstanceID, runner.ProcessGUID);

                var npc = new PreviousStepChecker();
                var previousActivityInstance = npc.GetPreviousActivityInstanceList(runningNode, true,
                                                                                   out hasGatewayNode).ToList()[0];

                //仅仅是回跳到上一步节点,即按SendBack方式处理
                if (previousActivityInstance.ActivityGUID == jumpBackActivityGUID)
                {
                    rmins.BackwardContext.BackwardToTaskActivityInstance = previousActivityInstance;
                    rmins.BackwardContext.BackwardToTargetTransitionGUID =
                        hasGatewayNode == false ? lastTaskTransitionInstance.TransitionGUID : WfDefine.WF_XPDL_GATEWAY_BYPASS_GUID;        //如果中间有Gateway节点,则没有直接相连的TransitonGUID

                    rmins.BackwardContext.BackwardFromActivity         = processModel.GetActivity(runningNode.ActivityGUID);
                    rmins.BackwardContext.BackwardFromActivityInstance = runningNode;
                    rmins.BackwardContext.BackwardTaskReceiver         = WfBackwardTaskReceiver.Instance(
                        previousActivityInstance.ActivityName,
                        previousActivityInstance.EndedByUserID,
                        previousActivityInstance.EndedByUserName);

                    rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(
                        previousActivityInstance.ActivityGUID,
                        previousActivityInstance.EndedByUserID,
                        previousActivityInstance.EndedByUserName);
                }
                else
                {
                    //回跳到早前节点
                    if (jumpBackActivityInstance.ActivityState != (short)ActivityStateEnum.Completed)
                    {
                        //回跳节点不在完成状态
                        result.Status        = WfExecutedStatus.Exception;
                        result.ExceptionType = WfExceptionType.Jump_NotActivityBackCompleted;
                        result.Message       = LocalizeHelper.GetEngineMessage("wfruntimemanagerfactory.CreateRuntimeInstanceJump.back.error");

                        return(rmins);
                    }

                    rmins.BackwardContext.BackwardToTaskActivityInstance = jumpBackActivityInstance;

                    //判断两个节点是否有Transition的定义存在
                    var transition = processModel.GetForwardTransition(runningNode.ActivityGUID, jumpBackActivityGUID);
                    rmins.BackwardContext.BackwardToTargetTransitionGUID = transition != null ? transition.TransitionGUID : WfDefine.WF_XPDL_GATEWAY_BYPASS_GUID;

                    rmins.BackwardContext.BackwardFromActivity         = processModel.GetActivity(runningNode.ActivityGUID);
                    rmins.BackwardContext.BackwardFromActivityInstance = runningNode;
                    rmins.BackwardContext.BackwardTaskReceiver         = WfBackwardTaskReceiver.Instance(
                        jumpBackActivityInstance.ActivityName,
                        jumpBackActivityInstance.EndedByUserID,
                        jumpBackActivityInstance.EndedByUserName);

                    rmins.AppRunner.NextActivityPerformers = ActivityResource.CreateNextActivityPerformers(
                        jumpBackActivityInstance.ActivityGUID,
                        jumpBackActivityInstance.EndedByUserID,
                        jumpBackActivityInstance.EndedByUserName);
                }
                //获取资源数据
                var activityResourceBack = new ActivityResource(rmins.AppRunner,
                                                                rmins.AppRunner.NextActivityPerformers,
                                                                runner.Conditions);
                rmins.ActivityResource = activityResourceBack;
            }
            else
            {
                //跳转到从未执行过的节点上
                var activityResource = new ActivityResource(runner, runner.NextActivityPerformers, runner.Conditions);
                rmins.ActivityResource        = activityResource;
                rmins.RunningActivityInstance = runningNode;
            }
            #endregion

            return(rmins);
        }