public static void LowerPackage(AstNode astNode, LoweringContext context)
        {
            var astPackage = astNode as AstTask.AstPackageNode;

            if (astPackage != null)
            {
                if (astPackage.Emit)
                {
                    var p = new Package(astPackage);
                    context.ParentObject.Children.Add(p);
                    context = new TaskLoweringContext(p);
                    LowerConnection(astPackage.LogConnection, context);
                    LowerChildren(astPackage, context);
                    LowerEventHandlers(astPackage, p, context);
                }
                else
                {
                    MessageEngine.Trace(
                        astPackage,
                        Severity.Debug,
                        "D_S008",
                        "Skipped Lowering of Package {0} because Emit was {1}",
                        astPackage.Name,
                        astPackage.Emit);
                }
            }
        }
        public static void LowerVariable(AstNode astNode, LoweringContext context)
        {
            var astVariable = astNode as AstTask.AstVariableNode;

            if (astVariable != null)
            {
                var v = new Variable(astVariable);
                context.ParentObject.Children.Add(v);
            }
        }
        public static void LowerConnection(AstNode astNode, LoweringContext context)
        {
            var astConnection = astNode as AstConnection.AstConnectionNode;

            if (astConnection != null)
            {
                Connection c = ConnectionFactory.CreateConnection(astConnection);
                context.ParentObject.Children.Add(c);
            }
        }
Exemple #4
0
        protected Transformation(LoweringContext context, AstTransformationNode astTransformationNode)
            : base(astTransformationNode.Name)
        {
            var dflc = context as DataflowLoweringContext;

            Dataflow = dflc.Dataflow;
            ValidateExternalMetadata = astTransformationNode.ValidateExternalMetadata;
            BindingList            = new Collection <Binding>();
            _astTransformationNode = astTransformationNode;
        }
Exemple #5
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);
            }
        }
Exemple #6
0
        public static void LowerSqlTask(AstNode astNode, LoweringContext context)
        {
            var astTask = astNode as AstExecuteSqlTaskNode;

            if (astTask != null)
            {
                var s = new SqlTask(astTask);
                ContainerLoweringEngine.LowerConnection(astTask.Connection, context);
                context.ParentObject.Children.Add(s);
                ContainerLoweringEngine.LowerEventHandlers(astTask, s, context);
            }
        }
Exemple #7
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astDestination = astNode as AstDestinationNode;

            if (astDestination != null)
            {
                var oleDBDestination = new OleDBDestination(context, astNode)
                {
                    _oleDBConnection = new OleDBConnection(astDestination.Table.Connection)
                };
                context.ParentObject.Children.Add(oleDBDestination._oleDBConnection);
                context.ParentObject.Children.Add(oleDBDestination);
            }
        }
Exemple #8
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astTermLookupNode = astNode as AstTermLookupNode;

            if (astTermLookupNode != null)
            {
                var termLookup = new TermLookup(context, astNode)
                {
                    _oleDBConnection = new OleDBConnection(astTermLookupNode.Connection)
                };
                context.ParentObject.Children.Add(termLookup._oleDBConnection);
                context.ParentObject.Children.Add(termLookup);
            }
        }
Exemple #9
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;

            if (astSlowlyChangingDimensionNode != null)
            {
                var slowlyChangingDimension = new SlowlyChangingDimension(context, astNode)
                {
                    _oleDBConnection = new OleDBConnection(astSlowlyChangingDimensionNode.Connection)
                };
                context.ParentObject.Children.Add(slowlyChangingDimension._oleDBConnection);
                context.ParentObject.Children.Add(slowlyChangingDimension);
            }
        }
        public static void LowerDataflow(AstNode astNode, LoweringContext context)
        {
            var astDataflow = astNode as AstEtlRootNode;

            if (astDataflow != null)
            {
                var dft = new DataflowTask(astDataflow);
                context.ParentObject.Children.Add(dft);

                var dflc = new DataflowLoweringContext(dft);
                LowerTransformations(astDataflow, dflc);
                ContainerLoweringEngine.LowerEventHandlers(astDataflow, dft, context);
            }
        }
Exemple #11
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astOleDBCommandNode = astNode as AstOleDBCommandNode;

            if (astOleDBCommandNode != null)
            {
                var oleDBCommand = new OleDBCommand(context, astNode)
                {
                    _oleDBConnection = new OleDBConnection(astOleDBCommandNode.Connection)
                };
                context.ParentObject.Children.Add(oleDBCommand._oleDBConnection);
                context.ParentObject.Children.Add(oleDBCommand);
            }
        }
        private static void LowerChildren(AstTask.AstContainerTaskNode container, LoweringContext context)
        {
            foreach (AstTask.AstVariableNode variable in container.Variables)
            {
                PhysicalLoweringProcessor.Lower(variable, context);
            }

            var sortedTasks = SortTasks(container, container.Tasks);

            foreach (AstTask.AstTaskNode task in sortedTasks)
            {
                PhysicalLoweringProcessor.Lower(task, context);
            }
        }
Exemple #13
0
        public Union(LoweringContext context, AstNode astNode)
            : base(context, astNode as AstTransformationNode)
        {
            _astUnionAllNode = astNode as AstUnionAllNode;

            if (_astUnionAllNode != null)
            {
                int i = 0;
                foreach (AstDataflowMappedInputPathNode ip in _astUnionAllNode.InputPaths)
                {
                    BindingList.Add(new MappedBinding(_astUnionAllNode.Name, ip.OutputPath.Transformation.Name, ip.OutputPath.SsisName, i, ip.Mappings));
                    i++;
                }
            }
        }
        public static void LowerContainer(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstContainerTaskNode;

            if (astContainer != null)
            {
                var seq = new PhysicalTask.Sequence(astContainer);
                context.ParentObject.Children.Add(seq);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(seq);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, seq, context);
            }
        }
        public static void LowerForLoop(AstNode astNode, LoweringContext context)
        {
            var astContainer = astNode as AstTask.AstForLoopContainerTaskNode;

            if (astContainer != null)
            {
                var forLoop = new PhysicalTask.ForLoop(astContainer);
                context.ParentObject.Children.Add(forLoop);
                LowerConnection(astContainer.LogConnection, context);

                context = new TaskLoweringContext(forLoop);
                LowerChildren(astContainer, context);
                LowerEventHandlers(astContainer, forLoop, context);
            }
        }
Exemple #16
0
        public static void CreateAndRegister(AstNode astNode, LoweringContext context)
        {
            var astQuerySourceNode = astNode as AstQuerySourceNode;

            if (astQuerySourceNode != null)
            {
                var oleDBSource = new OleDBSource(context, astNode)
                {
                    _oleDBConnection = new OleDBConnection(astQuerySourceNode.Connection)
                };

                // Note: vsabella: workaround for different behavior regarding expressions for OLEDB sources
                // versus how it works in Lookups.
                if (astQuerySourceNode.Query.QueryType == QueryType.Expression)
                {
                    // Variable name has to be only alphanumeric, more restrictive than astQuerySource Name
                    string varName  = "__" + System.Guid.NewGuid().ToString("N");
                    var    variable = new Variable(varName);
                    oleDBSource.SqlCommandVarName = "User::" + varName;

                    variable.TypeCode             = System.TypeCode.String;
                    variable.EvaluateAsExpression = true;
                    variable.ValueString          = astQuerySourceNode.Query.Body;
                    context.ParentObject.Children.Add(variable);
                }
                else
                {
                    foreach (AstVariableParameterMappingNode paramNode in astQuerySourceNode.Query.Parameters)
                    {
                        var variable = new Variable(paramNode.Variable);
                        oleDBSource._paramDictionary[paramNode.Name] = variable;
                        context.ParentObject.Children.Add(variable);
                    }
                }

                context.ParentObject.Children.Add(oleDBSource._oleDBConnection);
                context.ParentObject.Children.Add(oleDBSource);
            }
        }
Exemple #17
0
 public RowCount(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astRowCountNode = astNode as AstRowCountNode;
     RegisterInputBinding(_astRowCountNode);
 }
Exemple #18
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add(new RowCount(context, astNode));
 }
Exemple #19
0
 public DerivedColumns(LoweringContext context, AstNode astNode)
     : base(context, astNode as AstTransformationNode)
 {
     _astDerivedColumnListNode = astNode as AstDerivedColumnListNode;
     RegisterInputBinding(_astDerivedColumnListNode);
 }
Exemple #20
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new DerivedColumns(context, astNode)));
 }
 public static void LowerSort(AstNode astNode, LoweringContext context)
 {
     Sort.CreateAndRegister(astNode, context);
 }
 public static void LowerRowCount(AstNode astNode, LoweringContext context)
 {
     RowCount.CreateAndRegister(astNode, context);
 }
Exemple #23
0
 public SlowlyChangingDimension(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astSlowlyChangingDimensionNode = astNode as AstSlowlyChangingDimensionNode;
     RegisterInputBinding(_astSlowlyChangingDimensionNode);
 }
 public static void LowerOleDBCommand(AstNode astNode, LoweringContext context)
 {
     OleDBCommand.CreateAndRegister(astNode, context);
 }
Exemple #25
0
 public TermLookup(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astTermLookupNode = astNode as AstTermLookupNode;
     RegisterInputBinding(_astTermLookupNode);
 }
 public static void LowerOleDBSource(AstNode astNode, LoweringContext context)
 {
     OleDBSource.CreateAndRegister(astNode, context);
 }
Exemple #27
0
 public ConditionalSplit(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _astConditionalSplitNode = astNode as AstConditionalSplitNode;
     RegisterInputBinding(_astConditionalSplitNode);
 }
Exemple #28
0
 public static void CreateAndRegister(AstNode astNode, LoweringContext context)
 {
     context.ParentObject.Children.Add((new ConditionalSplit(context, astNode)));
 }
Exemple #29
0
 public OleDBSource(LoweringContext context, AstNode astNode) : base(context, astNode as AstTransformationNode)
 {
     _paramDictionary    = new Dictionary <string, Variable>();
     _astQuerySourceNode = astNode as AstQuerySourceNode;
 }
        public static void LowerEventHandlers(AstTask.AstTaskNode astTaskNode, Executable parentExecutable, LoweringContext context)
        {
            foreach (AstTask.AstTaskEventHandlerNode astTaskEventHandler in astTaskNode.Events)
            {
                PhysicalTask.EventHandler e = new IR.Tasks.EventHandler(astTaskEventHandler, parentExecutable);
                context.ParentObject.Children.Add(e);

                foreach (AstTask.AstTaskNode task in astTaskEventHandler.Tasks)
                {
                    context = new TaskLoweringContext(e);
                    PhysicalLoweringProcessor.Lower(task, context);
                }
            }
        }