/// <summary> /// 创建Gateway节点处理类实例 /// </summary> /// <param name="gActivity">节点</param> /// <param name="processModel">流程模型类</param> /// <param name="session">会话</param> /// <returns>Gateway节点处理实例</returns> internal static NodeMediatorGateway CreateNodeMediatorGateway(ActivityEntity gActivity, IProcessModel processModel, IDbSession session) { NodeMediatorGateway nodeMediator = null; if (gActivity.ActivityType == ActivityTypeEnum.GatewayNode) { if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndSplit) { nodeMediator = new NodeMediatorAndSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndSplitMI) { nodeMediator = new NodeMediatorAndSplitMI(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.OrSplit) { nodeMediator = new NodeMediatorOrSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.XOrSplit) { nodeMediator = new NodeMediatorXOrSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndJoin) { nodeMediator = new NodeMediatorAndJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndJoinMI) { nodeMediator = new NodeMediatorAndJoinMI(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.OrJoin) { nodeMediator = new NodeMediatorOrJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.XOrJoin) { nodeMediator = new NodeMediatorXOrJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.EOrJoin) { nodeMediator = new NodeMediatorEOrJoin(gActivity, processModel, session); } else { throw new XmlDefinitionException(string.Format("不明确的节点分支Gateway类型!{0}", gActivity.GatewayDirectionType.ToString())); } } else { throw new XmlDefinitionException(string.Format("不明确的节点类型!{0}", gActivity.ActivityType.ToString())); } return(nodeMediator); }
/// <summary> /// 创建Gateway节点处理类实例 /// </summary> /// <param name="gActivity">节点</param> /// <param name="processModel">流程模型类</param> /// <param name="session">会话</param> /// <returns>Gateway节点处理实例</returns> internal static NodeMediatorGateway CreateNodeMediatorGateway(ActivityEntity gActivity, IProcessModel processModel, IDbSession session) { NodeMediatorGateway nodeMediator = null; if (gActivity.ActivityType == ActivityTypeEnum.GatewayNode) { if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndSplit) { nodeMediator = new NodeMediatorAndSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.OrSplit) { nodeMediator = new NodeMediatorOrSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.XOrSplit) { nodeMediator = new NodeMediatorXOrSplit(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.AndJoin) { nodeMediator = new NodeMediatorAndJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.OrJoin) { nodeMediator = new NodeMediatorOrJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.XOrJoin) { nodeMediator = new NodeMediatorXOrJoin(gActivity, processModel, session); } else if (gActivity.GatewayDirectionType == GatewayDirectionEnum.EOrJoin) { nodeMediator = new NodeMediatorEOrJoin(gActivity, processModel, session); } else { throw new XmlDefinitionException(LocalizeHelper.GetEngineMessage("nodemediatorfactory.CreateNodeMediatorGateway.uncertaingateway.warn", gActivity.GatewayDirectionType.ToString())); } } else { throw new XmlDefinitionException(LocalizeHelper.GetEngineMessage("nodemediatorfactory.CreateNodeMediatorGateway.uncertain.warn", gActivity.ActivityType.ToString())); } return(nodeMediator); }