public H2HProcessing(String hub, String defaultEquipment, String defaultStandFrom, String defaultGateTo, String baggageTerminalCode, Int32 minLoadUnloadTime, Int32 maxLoadUnloadTime, Int32 maxBaggageTurnaround, SorterProcessingVolumeMap sorterVolumeMap, Int32 maxSorterThroughPut, Int32 sorterTime, List <OSUSR_UUK_BAGTIMESREFERENCE> refList, List <OSUSR_UUK_EQUIPTYPE> equipementTypeList, List <OSUSR_UUK_TAXITIMES> taxiTimesList, List <OSUSR_UUK_REGISTRATIONS> registrationList) { this.hub = hub; this.registrationList = registrationList; this.defaultEquipment = defaultEquipment; this.defaultStandFrom = defaultStandFrom; this.defaultGateTo = defaultGateTo; this.baggageTerminalCode = baggageTerminalCode; this.minLoadUnloadTime = minLoadUnloadTime; this.maxLoadUnloadTime = maxLoadUnloadTime; this.maxBaggageTurnaround = maxBaggageTurnaround; this.sorterVolumeMap = sorterVolumeMap; this.maxSorterThroughPut = maxSorterThroughPut; this.sorterTime = sorterTime; this.refList = refList; this.equipementTypeList = equipementTypeList; this.taxiTimesList = taxiTimesList; this.registrationList = registrationList; }
/// <summary> /// Constructor to create logger and tasks and queue parametrization /// </summary> public ExecutionDataflowEngineProcessing() { BagTMLog.LogDebug("BagTM Engine Processing Constructor", this); config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None) as Configuration; hub = this.GetAppSetting(config, "hub"); if (hub == null) { throw new EngineProcessingException("No hub defined to process TTY messages"); } airline = this.GetAppSetting(config, "airline"); if (airline == null) { throw new EngineProcessingException("No airline defined to process TTY messages"); } BagTMLog.LogDebug("BagTM Engine Processing hub ", hub); String timeSpanParameter = this.GetAppSetting(config, "timeSpan"); int timeSpanNumber = 0; if (!int.TryParse(timeSpanParameter, out timeSpanNumber)) { throw new EngineProcessingException("Parameter TimeSpan incorrectly configured"); } this.timeSpan = new TimeSpan((Int64)(timeSpanNumber * TimeSpan.TicksPerMillisecond)); BagTMLog.LogDebug("BagTM Engine Processing Constructor timeSpanNumber", this.timeSpan); String parallelismCounterParameter = this.GetAppSetting(config, "parallelismCounter"); if (!int.TryParse(parallelismCounterParameter, out this.parallelismCounter)) { throw new EngineProcessingException("Parameter ParallelismCounter incorrectly configured"); } BagTMLog.LogDebug("BagTM Engine Processing Constructor parallelismCounterParameter", parallelismCounterParameter); queueEngine = this.CreateMessageQueue(QUEUEENGINE); queueEngineSucess = this.CreateMessageQueue(QUEUESUCESS); queueEngineError = this.CreateMessageQueue(QUEUEERROR); BagTMLog.LogDebug("BagTM Engine Processing Constructor queueEngine", queueEngine); BagTMLog.LogDebug("BagTM Engine Processing Constructor queueEngineSucess", queueEngineSucess); BagTMLog.LogDebug("BagTM Engine Processing Constructor queueEngineError", queueEngineError); baggageTerminalCode = this.GetAppSetting(config, "baggageTerminal"); if (baggageTerminalCode == null) { throw new EngineProcessingException("No baggage terminal configured"); } String sorterTimeParameter = this.GetAppSetting(config, "sorterTime"); if (!int.TryParse(sorterTimeParameter, out sorterTime)) { throw new EngineProcessingException("Parameter sorter time incorrectly configured"); } String etcgParameter = this.GetAppSetting(config, "etcg"); if (!int.TryParse(sorterTimeParameter, out etcg)) { throw new EngineProcessingException("Parameter estimated time to close gate incorrectly configured"); } defaultEquipment = this.GetAppSetting(config, "defaultEquipment"); if (!int.TryParse(defaultEquipment, out int aux)) { throw new EngineProcessingException("Parameter default equipment incorrectly configured"); } defaultStandFrom = this.GetAppSetting(config, "defaultStandFrom"); if (defaultStandFrom == null) { throw new EngineProcessingException("No default stand from configured"); } defaultGateTo = this.GetAppSetting(config, "defaultGateTo"); if (defaultGateTo == null) { throw new EngineProcessingException("No default stand to configured"); } String maxPaxTurnaroundParameter = this.GetAppSetting(config, "maxPaxTurnaround"); if (!int.TryParse(maxPaxTurnaroundParameter, out this.maxPaxTurnaround)) { throw new EngineProcessingException("No max pax turnaround configured"); } String maxBaggageTurnaroundParameter = this.GetAppSetting(config, "maxBaggageTurnaround"); if (!int.TryParse(maxBaggageTurnaroundParameter, out this.maxBaggageTurnaround)) { throw new EngineProcessingException("No max baggage turnaround configured"); } String maxSorterThroughPutParameter = this.GetAppSetting(config, "maxSorterThroughPut"); if (!int.TryParse(maxSorterThroughPutParameter, out this.maxSorterThroughPut)) { throw new EngineProcessingException("No max sorter through put configured"); } String minLoadUnloadTimeParameter = this.GetAppSetting(config, "minLoadUnloadTime"); if (!int.TryParse(minLoadUnloadTimeParameter, out this.minLoadUnloadTime)) { throw new EngineProcessingException("No min load / unload configured"); } String maxLoadUnloadTimeParameter = this.GetAppSetting(config, "maxLoadUnloadTime"); if (!int.TryParse(maxLoadUnloadTimeParameter, out this.maxLoadUnloadTime)) { throw new EngineProcessingException("No max load / unload configured"); } //Load rules var repository = new RuleRepository(); Type[] ruleTypes = new Type[13]; repository.Load(x => x .From(Assembly.GetExecutingAssembly()).To("BagTMRuleSet") .Where(r => r.IsTagged("BagIntegrity"))); BagTMLog.LogDebug("BagTM Engine Processing Constructor repository", repository); //Compile rules var ruleSets = repository.GetRuleSets(); var compiler = new RuleCompiler(); factory = compiler.Compile(ruleSets); //Create a working session factory.Events.FactInsertedEvent += BagRulesEventMonitorization.OnFactInsertedEvent; factory.Events.FactUpdatedEvent += BagRulesEventMonitorization.OnFactUpdatedEvent; factory.Events.FactRetractedEvent += BagRulesEventMonitorization.OnFactRetractedEvent; factory.Events.ActivationCreatedEvent += BagRulesEventMonitorization.OnActivationCreatedEvent; factory.Events.ActivationUpdatedEvent += BagRulesEventMonitorization.OnActivationUpdatedEvent; factory.Events.ActivationDeletedEvent += BagRulesEventMonitorization.OnActivationDeletedEvent; factory.Events.RuleFiringEvent += BagRulesEventMonitorization.OnRuleFiringEvent; factory.Events.RuleFiredEvent += BagRulesEventMonitorization.OnRuleFireEvent; factory.Events.ActionFailedEvent += BagRulesEventMonitorization.OnActionFailedEvent; factory.Events.ConditionFailedEvent += BagRulesEventMonitorization.OnConditionFailedEvent; this.sorterVolumeMap = new SorterProcessingVolumeMap(); BagTMLog.LogDebug("BagTM Engine Processing Constructor factory", factory); this.RefreshRefLists(); BagTMLog.LogDebug( String.Format("BagTM Engine Processing Task Process Message Define Dataflow Block Parallelism Counter {0}", parallelismCounter) , this); BagTMLog.LogDebug("BagTM Engine Processing Constructor Ending", this); }