示例#1
0
        public OLEDBCommand(
            VulcanPackage vulcanPackage,
            MainPipe dataFlowTask,
            IDTSComponentMetaData90
            parentComponent,
            string name,
            string description,
            Connection connection,
            string command
            )
            : base(vulcanPackage,
            dataFlowTask,
            parentComponent,
            name,
            description)
        {
            _oledbCom = dataFlowTask.ComponentMetaDataCollection.New();
            _oledbCom.ComponentClassID = "DTSTransform.OLEDBCommand";

            //IMPORTANT! If you do not Instantiate() first, the component names do not get set... this is bad.
            _oledbComI = _oledbCom.Instantiate();
            _oledbComI.ProvideComponentProperties();

            _oledbCom.Name        = name;
            _oledbCom.Description = description;

            _oledbCom.RuntimeConnectionCollection[0].ConnectionManagerID = connection.ConnectionManager.ID;
            _oledbCom.RuntimeConnectionCollection[0].ConnectionManager =
                DTS.DtsConvert.ToConnectionManager90(connection.ConnectionManager);

            _oledbComI.SetComponentProperty("SqlCommand", command);

            dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(
                                                                                parentComponent.OutputCollection[0],
                                                                                _oledbCom.InputCollection[0]
                                                                                );

            try
            {
                _oledbComI.AcquireConnections(null);
                _oledbComI.ReinitializeMetaData();
                _oledbComI.ReleaseConnections();
            }
            catch (System.Runtime.InteropServices.COMException ce)
            {
                Message.Trace(Severity.Error,ce,"OLEDBCommand: {3}: {2}: Source {0}: Command {1}", connection.ConnectionManager.Name, command, ce.Message, _oledbCom.GetErrorDescription(ce.ErrorCode));
            }
            catch (Exception e)
            {
                Message.Trace(Severity.Error,e,"OLEDBCommand: {2}: Source {0}: Command {1}", connection.ConnectionManager.Name, command, e.Message);
            }

            AutoMap();
        }
示例#2
0
 protected Transformation(
     Packages.VulcanPackage vulcanPackage,
     MainPipe dataFlowTask,
     IDTSComponentMetaData90 parentComponent,
     string name,
     string description
     )
 {
     this._vulcanPackage = vulcanPackage;
     this._dataFlowTask = dataFlowTask;
     this._parentComponent = parentComponent;
     this._name = name;
     this._description = description;
 }
示例#3
0
文件: TermLookup.cs 项目: japj/vulcan
        public TermLookup(
           VulcanPackage vulcanPackage,
           MainPipe dataFlowTask,
           IDTSComponentMetaData90 parentComponent,
           string name,
           string description,
           Connection connection,
            bool isCaseSensitive,
            string refTermColumn,
            string refTermTable
           )
            : base(vulcanPackage,
           dataFlowTask,
           parentComponent,
           name,
           description)
        {
            TermLookupCom = dataFlowTask.ComponentMetaDataCollection.New();
            TermLookupCom.ComponentClassID = "DTSTransform.TermLookup";

            TermLookupComI = TermLookupCom.Instantiate();
            TermLookupComI.ProvideComponentProperties();

            TermLookupCom.Name = name;

            TermLookupCom.RuntimeConnectionCollection[0].ConnectionManagerID = connection.ConnectionManager.ID;
            TermLookupCom.RuntimeConnectionCollection[0].ConnectionManager =
                DTS.DtsConvert.ToConnectionManager90(connection.ConnectionManager);

            TermLookupComI.SetComponentProperty("IsCaseSensitive", isCaseSensitive);
            TermLookupComI.SetComponentProperty("RefTermColumn", refTermColumn);
            TermLookupComI.SetComponentProperty("RefTermTable", refTermTable);
            TermLookupCom.OutputCollection[0].ErrorRowDisposition = DTSRowDisposition.RD_IgnoreFailure;

            dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(
                                                                                  parentComponent.OutputCollection[0],
                                                                                  TermLookupCom.InputCollection[0]
                                                                                  );
            TermLookupComI.AcquireConnections(null);
            TermLookupComI.ReinitializeMetaData();
            TermLookupComI.ReleaseConnections();
        }
示例#4
0
文件: Lookup.cs 项目: japj/vulcan
        public Lookup(
           VulcanPackage vulcanPackage,
           MainPipe dataFlowTask,
           IDTSComponentMetaData90
           parentComponent,
           string name,
           string description,
           Connection connection,
            string query
           )
            : base(vulcanPackage,
           dataFlowTask,
           parentComponent,
           name,
           description)
        {
            lookupCom = dataFlowTask.ComponentMetaDataCollection.New();
            lookupCom.ComponentClassID = "DTSTransform.Lookup";

            lookupComI = lookupCom.Instantiate();
            lookupComI.ProvideComponentProperties();

            lookupCom.Name = name;

            lookupCom.RuntimeConnectionCollection[0].ConnectionManagerID = connection.ConnectionManager.ID;
            lookupCom.RuntimeConnectionCollection[0].ConnectionManager =
                DTS.DtsConvert.ToConnectionManager90(connection.ConnectionManager);

            lookupComI.SetComponentProperty("SqlCommand", query);

            lookupCom.OutputCollection[0].ErrorRowDisposition = DTSRowDisposition.RD_IgnoreFailure;

            dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(
                                                                                  parentComponent.OutputCollection[0],
                                                                                  lookupCom.InputCollection[0]
                                                                                  );
            lookupComI.AcquireConnections(null);
            lookupComI.ReinitializeMetaData();
            lookupComI.ReleaseConnections();
        }
示例#5
0
文件: Vulcan.cs 项目: japj/vulcan
        public MessageEngine Compile(string vulcanFile)
        {
            if (File.Exists(vulcanFile))
            {
                Message.PushMessageEngine(vulcanFile);
                VulcanConfig vulcanConfig = _templateManager.XmlTemplateReplacement(new VulcanConfig(vulcanFile));
                foreach (XPathNavigator nav in vulcanConfig.Navigator.Select("//rc:VulcanConfig/rc:Package", vulcanConfig.NamespaceManager))
                {
                    string name = nav.SelectSingleNode("@Name").Value;
                    string packageType = nav.SelectSingleNode("@PackageType").Value;

                    VulcanPackage vulcanPackage = vulcanPackage = new VulcanPackage(name, packageType, vulcanConfig, _templateManager, nav);
                    try
                    {
                        vulcanPackage.ProcessPackage();
                    }
                    catch (Exception)
                    {
                        if (vulcanPackage != null)
                        {
                            if (Settings.Default.CleanupFilesOnError)
                            {
                                vulcanPackage.UnSave();
                            }
                            else
                            {
                                vulcanPackage.Save();
                                vulcanPackage.Validate();
                            }
                        }
                    }
                }
            }
            else
            {
                Message.Trace(Severity.Error, new FileNotFoundException("Vulcan File Not Found", vulcanFile), "VulcanFile {0} not found", vulcanFile);
            }
            return Message.PopMessageEngine();
        }
示例#6
0
文件: Sort.cs 项目: japj/vulcan
        public Sort(
           VulcanPackage vulcanPackage,
           MainPipe dataFlowTask,
           IDTSComponentMetaData90
           parentComponent,
           string name,
           string description,
           bool eliminateDuplicates,
           int maximumThreads
           )
            : base(vulcanPackage,
           dataFlowTask,
           parentComponent,
           name,
           description)
        {
            _sortOrder = 1;

            _sortCom = dataFlowTask.ComponentMetaDataCollection.New();
            _sortCom.ComponentClassID = "DTSTransform.sort";

            _sortComI = _sortCom.Instantiate();
            _sortComI.ProvideComponentProperties();

            _sortCom.Name = name;

            _sortComI.SetComponentProperty("EliminateDuplicates", eliminateDuplicates);
            _sortComI.SetComponentProperty("MaximumThreads", maximumThreads);
            _sortCom.OutputCollection[0].ErrorRowDisposition = DTSRowDisposition.RD_NotUsed;

            dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(
                                                                                  parentComponent.OutputCollection[0],
                                                                                  _sortCom.InputCollection[0]
                                                                                  );
            _sortComI.AcquireConnections(null);
            _sortComI.ReinitializeMetaData();
            _sortComI.ReleaseConnections();
        }
示例#7
0
文件: UnionAll.cs 项目: japj/vulcan
        public UnionAll(
           VulcanPackage vulcanPackage,
           MainPipe dataFlowTask,
           IDTSComponentMetaData90
           parentComponent,
           string name,
           string description
           )
            : base(vulcanPackage,
           dataFlowTask,
           parentComponent,
           name,
           description)
        {
            unionAllCom = dataFlowTask.ComponentMetaDataCollection.New();
            unionAllCom.ComponentClassID = "DTSTransform.UnionAll";

            unionAllComI = unionAllCom.Instantiate();
            unionAllComI.ProvideComponentProperties();

            unionAllCom.Name = name;

            unionAllCom.OutputCollection[0].ErrorRowDisposition = DTSRowDisposition.RD_NotUsed;
        }
示例#8
0
 public ExpressionPathBuilder(VulcanPackage vulcanPackage)
 {
     this._vulcanPackage = vulcanPackage;
 }