public void AddMetaInstruction(string fullyQualifiedClass) { try { //Resolve the metaInstructionType based on the fully qualified class/assembly name, and then create an instance //of the metaInstruction Type metaInstructionType = ObjectCreator.ResolveType(fullyQualifiedClass); object o = ObjectCreator.CreateConstructorlessInstance(metaInstructionType); if (o != null) { //If the instantiated object isn't null then add it to the MetaInstructionCollection BREPipelineMetaInstructionBase metaInstruction = (BREPipelineMetaInstructionBase)o; AddMetaInstruction(metaInstruction); } else { //If the instantiated object is null then set _BREException which will be thrown by the pipeline component _BREException = new Exception("Unable to instantiate MetaInstruction - " + fullyQualifiedClass); } } catch (Exception e) { //Set any caught exceptions to _BREException which will be thrown by the pipeline component _BREException = new Exception("Unable to instantiate MetaInstruction - " + fullyQualifiedClass + ", exception encountered - " + e.Message); } }
/// <summary> /// Add a given metaInstruction instance to the collection /// </summary> public void AddMetaInstruction(BREPipelineMetaInstructionBase metaInstruction) { string key = metaInstruction.GetType().ToString(); if (instructionExecutionOrder == InstructionExecutionOrderEnum.RulesExecution) { metaInstruction.InstructionCollection = orderedInstructionList; } metaInstruction.PartNames = partNames; if (!metaInstructionCollection.ContainsKey(key)) { metaInstruction._InMsg = inMsg; metaInstruction.Pc = pc; metaInstruction.CallToken = callToken; metaInstructionCollection.Add(key, metaInstruction); } }