/// <summary> /// 根据Transition,获取下一步节点列表 /// </summary> /// <param name="forwardTransition">转移实体</param> /// <param name="conditionKeyValuePair">条件kv对</param> /// <param name="session">会话</param> /// <param name="resultType">结果类型</param> protected NextActivityComponent GetNextActivityListFromGatewayCore(TransitionEntity forwardTransition, IDictionary <string, string> conditionKeyValuePair, IDbSession session, out NextActivityMatchedType resultType) { NextActivityComponent child = null; if (XPDLHelper.IsSimpleComponentNode(forwardTransition.ToActivity.ActivityType) == true) //可流转简单类型节点 { child = NextActivityComponentFactory.CreateNextActivityComponent(forwardTransition, forwardTransition.ToActivity); resultType = NextActivityMatchedType.Successed; } else if (forwardTransition.ToActivity.ActivityType == ActivityTypeEnum.GatewayNode) { child = GetNextActivityListFromGateway(forwardTransition, forwardTransition.ToActivity, conditionKeyValuePair, session, out resultType); } else if (forwardTransition.ToActivity.ActivityType == ActivityTypeEnum.IntermediateNode) { if (forwardTransition.ToActivity.ActivityTypeDetail.TriggerType == TriggerTypeEnum.Timer) { child = NextActivityComponentFactory.CreateNextActivityComponent(forwardTransition, forwardTransition.ToActivity); resultType = NextActivityMatchedType.Successed; } else { NextActivityScheduleBase activitySchedule = NextActivityScheduleFactory.CreateActivityScheduleIntermediate(this.ProcessModel); child = activitySchedule.GetNextActivityListFromGateway(forwardTransition, forwardTransition.ToActivity, conditionKeyValuePair, session, out resultType); } } else if (forwardTransition.ToActivity.ActivityType == ActivityTypeEnum.ServiceNode) { NextActivityScheduleBase activitySchedule = NextActivityScheduleFactory.CreateActivityScheduleIntermediate(this.ProcessModel); child = activitySchedule.GetNextActivityListFromGateway(forwardTransition, forwardTransition.ToActivity, conditionKeyValuePair, session, out resultType); } else { resultType = NextActivityMatchedType.Failed; throw new XmlDefinitionException(LocalizeHelper.GetEngineMessage("nextactivityschedulebase.unknownnodetype", forwardTransition.ToActivity.ActivityType.ToString())); } return(child); }
/// <summary> /// 创建ActivitySchedule /// </summary> /// <param name="processModel">流程模型</param> /// <param name="splitJoinType">分支合并类型</param> /// <returns>下一步调度类</returns> internal static NextActivityScheduleBase CreateActivitySchedule(IProcessModel processModel, GatewaySplitJoinTypeEnum splitJoinType) { NextActivityScheduleBase activitySchedule = null; if (splitJoinType == GatewaySplitJoinTypeEnum.Split) { activitySchedule = new NextActivityScheduleSplit(processModel); } else if (splitJoinType == GatewaySplitJoinTypeEnum.Join) { activitySchedule = new NextActivityScheduleJoin(processModel); } else { throw new Exception("未知的splitJoinType!"); } return(activitySchedule); }
/// <summary> /// 创建ActivitySchedule /// </summary> /// <param name="processModel">流程模型</param> /// <param name="splitJoinType">分支合并类型</param> /// <returns>下一步调度类</returns> internal static NextActivityScheduleBase CreateActivitySchedule(IProcessModel processModel, GatewaySplitJoinTypeEnum splitJoinType) { NextActivityScheduleBase activitySchedule = null; if (splitJoinType == GatewaySplitJoinTypeEnum.Split) { activitySchedule = new NextActivityScheduleSplit(processModel); } else if (splitJoinType == GatewaySplitJoinTypeEnum.Join) { activitySchedule = new NextActivityScheduleJoin(processModel); } else { //未知的splitJoinType throw new Exception(LocalizeHelper.GetEngineMessage("nextactivityschedulefactory.unknownnodetype")); } return(activitySchedule); }