Beispiel #1
0
        /// <summary>
        /// 获取当前节点的下一个节点信息
        /// </summary>
        /// <param name="currentActivitystring"></param>
        /// <returns></returns>
        internal ActivityEntity GetNextActivity(Guid activityGUID)
        {
            TransitionManager tm             = new TransitionManager(this.ProcessEntity);
            XmlNode           transitionNode = tm.GetForwardXmlTransitionNode(activityGUID);

            return(GetActivityFromTransitionTo(transitionNode));
        }
Beispiel #2
0
        /// <summary>
        /// 获取下一步节点列表,伴随条件信息
        /// </summary>
        /// <param name="currentActivity"></param>
        /// <param name="conditionKeyValuePair"></param>
        /// <returns></returns>
        internal NextActivityMatchedResult GetNextActivityList(Guid ProcessInstanceGUID,
                                                               ActivityEntity currentActivity,
                                                               ConditionKeyValuePair conditionKeyValuePair)
        {
            NextActivityMatchedResult result     = null;
            NextActivityMatchedType   resultType = NextActivityMatchedType.Unknown;

            //创建“下一步节点”的根节点
            NextActivityComponent root  = NextActivityComponentFactory.CreateNextActivityComponent();
            NextActivityComponent child = null;

            TransitionManager       tm             = new TransitionManager(this.ProcessEntity);
            List <TransitionEntity> transitionList = tm.GetForwardTransitionList(currentActivity.ActivityGUID,
                                                                                 conditionKeyValuePair).ToList();

            if (transitionList.Count > 0)
            {
                //遍历连线,获取下一步节点的列表
                foreach (TransitionEntity transition in transitionList)
                {
                    if (transition.ToActivity.NodeType == NodeTypeEnum.EndNode ||
                        transition.ToActivity.NodeType == NodeTypeEnum.TaskNode)
                    {
                        child = NextActivityComponentFactory.CreateNextActivityComponent(transition, transition.ToActivity);
                    }
                    else if (transition.ToActivity.NodeType == NodeTypeEnum.GatewayNode)
                    {
                        NextActivityScheduleBase activitySchedule = NextActivityScheduleFactory.CreateActivitySchedule(this.ProcessEntity,
                                                                                                                       transition.ToActivity.GatewaySplitJoinType);

                        child = activitySchedule.GetNextActivityListFromGateway(ProcessInstanceGUID,
                                                                                transition,
                                                                                transition.ToActivity,
                                                                                conditionKeyValuePair,
                                                                                out resultType);
                    }
                    else
                    {
                        throw new XmlDefinitionException(string.Format("未知的节点类型:{0}", transition.ToActivity.NodeType.ToString()));
                    }

                    if (child != null)
                    {
                        root.Add(child);
                        resultType = NextActivityMatchedType.Successed;
                    }
                }
            }
            else
            {
                resultType = NextActivityMatchedType.NoneTransitionFilteredByCondition;
            }
            result = NextActivityMatchedResult.CreateNextActivityMatchedResultObject(resultType, root);
            return(result);
        }