예제 #1
0
        private static Transformation CreateUnionAllFromXml(Vulcan.Packages.VulcanPackage vulcanPackage, IDTSComponentMetaData90 parentComponent, MainPipe dataFlowTask, XPathNavigator unionAllNav)
        {
            if (unionAllNav == null || unionAllNav.Name.ToUpperInvariant() != "UnionAll".ToUpperInvariant())
            {
                return(null);
            }
            string unionAllName = unionAllNav.SelectSingleNode("@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value;

            Message.Trace(Severity.Debug, "Begin: UnionAll Transformation {0}", unionAllName);
            UnionAll ua = new UnionAll(
                vulcanPackage,
                dataFlowTask,
                parentComponent,
                unionAllName,
                unionAllName
                );


            foreach (XPathNavigator navInput in unionAllNav.Select("rc:SourceComponent", vulcanPackage.VulcanConfig.NamespaceManager))
            {
                string sourceComponentName = navInput.SelectSingleNode("@SourceComponentName", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                ua.Component.InputCollection.New().Name = "Input for " + sourceComponentName;

                ua.MapInput(sourceComponentName, dataFlowTask);

                foreach (XPathNavigator navInputColumn in navInput.Select("rc:Map", vulcanPackage.VulcanConfig.NamespaceManager))
                {
                    string sourceColumnName = navInputColumn.SelectSingleNode("@Source", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                    string destinationColumnName;
                    bool   unMap = false;
                    if (navInputColumn.SelectSingleNode("@Destination") == null)
                    {
                        unMap = true;
                        destinationColumnName = sourceColumnName;
                    }
                    else
                    {
                        destinationColumnName = navInputColumn.SelectSingleNode("@Destination", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                    }
                    ua.MapInputColumn(sourceComponentName, sourceColumnName, destinationColumnName, unMap);
                }
            }

            ua.InitializeAndMapDestination();
            return(ua);
        }
예제 #2
0
        private static Transformation CreateUnionAllFromXml(Vulcan.Packages.VulcanPackage vulcanPackage, IDTSComponentMetaData90 parentComponent, MainPipe dataFlowTask, XPathNavigator unionAllNav)
        {
            if (unionAllNav == null || unionAllNav.Name.ToUpperInvariant() != "UnionAll".ToUpperInvariant())
            {
                return null;
            }
            string unionAllName = unionAllNav.SelectSingleNode("@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value;
            Message.Trace(Severity.Debug, "Begin: UnionAll Transformation {0}", unionAllName);
            UnionAll ua = new UnionAll(
                  vulcanPackage,
                dataFlowTask,
                parentComponent,
                unionAllName,
                unionAllName
                );

            foreach (XPathNavigator navInput in unionAllNav.Select("rc:SourceComponent", vulcanPackage.VulcanConfig.NamespaceManager))
            {
                string sourceComponentName = navInput.SelectSingleNode("@SourceComponentName", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                ua.Component.InputCollection.New().Name = "Input for " + sourceComponentName;

                ua.MapInput(sourceComponentName, dataFlowTask);

                foreach (XPathNavigator navInputColumn in navInput.Select("rc:Map", vulcanPackage.VulcanConfig.NamespaceManager))
                {
                    string sourceColumnName = navInputColumn.SelectSingleNode("@Source", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                    string destinationColumnName;
                    bool unMap = false;
                    if (navInputColumn.SelectSingleNode("@Destination") == null)
                    {
                        unMap = true;
                        destinationColumnName = sourceColumnName;
                    }
                    else
                    {
                        destinationColumnName = navInputColumn.SelectSingleNode("@Destination", vulcanPackage.VulcanConfig.NamespaceManager).Value;
                    }
                    ua.MapInputColumn(sourceComponentName, sourceColumnName, destinationColumnName, unMap);
                }

            }

            ua.InitializeAndMapDestination();
            return ua;
        }