Esempio n. 1
0
        private void Initialize(ExecutePackageTask execPackage)
        {
            string expression;

            if (Path.IsPathRooted(execPackage.RelativePath))
            {
                expression = String.Format("\"{0}\"", execPackage.RelativePath);
            }
            else
            {
                expression = SSISExpressionPathBuilder.BuildExpressionPath
                             (
                    Context.Package.PackageRelativeDirectory
                    + Path.DirectorySeparatorChar
                    + execPackage.RelativePath
                             );
            }

            string name = execPackage.RelativePath.Replace(Path.DirectorySeparatorChar, '_');

            name = name.Replace('.', '_');
            _execPackageTaskHost.Name = name + Guid.NewGuid().ToString();

            ConnectionConfiguration config = new ConnectionConfiguration();

            config.Name             = name;
            config.Type             = "FILE";
            config.ConnectionString = expression;

            SsisConnection connection = new SsisConnection(config);

            SSISTask.Connection = connection.ConnectionManager.Name;
        }
Esempio n. 2
0
        public static void LowerExecutePackage(AstNode astNode, LoweringContext context)
        {
            var astTask = astNode as AstExecutePackageTaskNode;

            if (astTask != null)
            {
                var ep = new ExecutePackageTask(astTask);
                context.ParentObject.Children.Add(ep);
                ContainerLoweringEngine.LowerEventHandlers(astTask, ep, context);
            }
        }
        private void CheckExecutePackageTask(TaskHost taskHost, TreeNode parent)
        {
            ExecutePackageTask task = taskHost.InnerObject as ExecutePackageTask;

            TreeNode parameterAssignments = AddFolder("ParameterAssignments", parent);

            // IDTSParameterAssignment doesn't support foreach enumeration, so use for loop instead.
            for (int i = 0; i < task.ParameterAssignments.Count; i++)
            {
                IDTSParameterAssignment assignment = task.ParameterAssignments[i];

                string match;
                string value = assignment.BindedVariableOrParameterName;
                if (!string.IsNullOrEmpty(value) && PropertyMatchEval(value, out match))
                {
                    VariableFoundEventArgs info = new VariableFoundEventArgs();
                    info.Match = match;
                    OnRaiseVariableFound(info);
                    AddNode(parameterAssignments, assignment.ParameterName.ToString(), GetImageIndex(IconKeyProperty), assignment, true);
                }
            }
        }
Esempio n. 4
0
        public override void Emit(XPathNavigator patternNavigator)
        {
            if (patternNavigator != null)
            {
                ExpressionPathBuilder epb = new ExpressionPathBuilder(VulcanPackage);
                string relativePath       = patternNavigator.SelectSingleNode("@RelativePath").Value;

                string expression = epb.BuildRelativeExpression(
                    "varRootDir",
                    relativePath
                    );

                relativePath = relativePath.Replace(Path.DirectorySeparatorChar, '_');
                relativePath = relativePath.Replace('.', '_');

                Connection         c   = new Connection(VulcanPackage, relativePath, relativePath, "FILE", expression);
                ExecutePackageTask ept = new ExecutePackageTask(VulcanPackage, relativePath, relativePath, ParentContainer, c);

                this.FirstExecutableGeneratedByPattern = ept.TaskHost;
                this.LastExecutableGeneratedByPattern  = ept.TaskHost;
            }
        }
Esempio n. 5
0
 public SsisExecutePackage(ExecutePackageTask execPackage, SSISEmitterContext context)
     : base(execPackage, context)
 {
     _execPackageTaskHost = (DTS.TaskHost)Context.SSISSequence.AppendExecutable("STOCK:ExecutePackageTask");
     Initialize(execPackage);
 }