private static Transformation CreateTermLookupFromXml(Vulcan.Packages.VulcanPackage vulcanPackage, IDTSComponentMetaData90 parentComponent, MainPipe dataFlowTask, XPathNavigator termLookupNav) { if (termLookupNav == null || termLookupNav.Name.ToUpperInvariant() != "TermLookup".ToUpperInvariant()) { return(null); } string termLookupName = termLookupNav.SelectSingleNode("@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value; bool isCaseSensitive = termLookupNav.SelectSingleNode("@IsCaseSensitive").ValueAsBoolean; string refTermColumn = termLookupNav.SelectSingleNode("@RefTermColumn").Value; string refTermTable = termLookupNav.SelectSingleNode("@RefTermTable").Value; Message.Trace(Severity.Debug, "Begin: TermLookup Transformation {0}", termLookupName); Connection sourceConnection = Connection.GetExistingConnection(vulcanPackage, termLookupNav.SelectSingleNode("@ConnectionName").Value); TermLookup tl = new TermLookup( vulcanPackage, dataFlowTask, parentComponent, termLookupName, termLookupName, sourceConnection, isCaseSensitive, refTermColumn, refTermTable ); foreach (XPathNavigator nav in termLookupNav.Select("rc:InputColumn", vulcanPackage.VulcanConfig.NamespaceManager)) { string inputColumnName = nav.SelectSingleNode("@InputColumnName").Value; TermLookup.InputColumnUsageType inputColumnUsageType = (TermLookup.InputColumnUsageType)Enum.Parse(typeof(TermLookup.InputColumnUsageType), nav.SelectSingleNode("@InputColumnUsageType").Value); tl.MapInput(inputColumnName, inputColumnUsageType); } return(tl); }
public void MapInput(string inputColumnName, TermLookup.InputColumnUsageType inputColumnUsageType) { this.SetInputUsageType(inputColumnName, DTSUsageType.UT_READONLY); ComponentInstance.SetInputColumnProperty( Component.InputCollection[0].ID, Component.InputCollection[0].InputColumnCollection[inputColumnName].ID, "InputColumnType", (int)inputColumnUsageType ); }