Example #1
0
        protected AstTableColumnBaseNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            SingletonPropertyChanged += AstTableColumnBaseNode_SingletonPropertyChanged;
        }
Example #2
0
 protected AstTransformationNode(IFrameworkItem parentAstNode)
     : base(parentAstNode)
 {
     InitializeAstNode();
     DefinedColumns = new VulcanCollection<AstTransformationColumnNode>();
     StaticOutputPaths = new VulcanCollection<AstDataflowOutputPathNode>();
 }
        public AstSlowlyChangingDimensionNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            UnchangedPath = new AstDataflowOutputPathNode(this) { Name = "Unchanged", SsisName = UnchangedSsisName };
            NewPath = new AstDataflowOutputPathNode(this) { Name = "New", SsisName = NewSsisName };
            FixedAttributePath = new AstDataflowOutputPathNode(this) { Name = "FixedAttribute", SsisName = FixedAttributeSsisName };
            ChangingAttributePath = new AstDataflowOutputPathNode(this) { Name = "ChangingAttribute", SsisName = ChangingAttributeSsisName };
            HistoricalAttributePath = new AstDataflowOutputPathNode(this) { Name = "HistoricalAttribute", SsisName = HistoricalAttributeSsisName };
            InferredMemberPath = new AstDataflowOutputPathNode(this) { Name = "InferredMember", SsisName = InferredMemberSsisName };

            UnchangedPath.DefineSymbol();
            NewPath.DefineSymbol();
            FixedAttributePath.DefineSymbol();
            ChangingAttributePath.DefineSymbol();
            HistoricalAttributePath.DefineSymbol();
            InferredMemberPath.DefineSymbol();

            StaticOutputPaths.Add(UnchangedPath);
            StaticOutputPaths.Add(NewPath);
            StaticOutputPaths.Add(FixedAttributePath);
            StaticOutputPaths.Add(ChangingAttributePath);
            StaticOutputPaths.Add(HistoricalAttributePath);
            StaticOutputPaths.Add(InferredMemberPath);
        }
Example #4
0
 protected AstTaskNode(IFrameworkItem parentAstNode)
     : base(parentAstNode)
 {
     InitializeAstNode();
     OutputPath = new AstTaskflowOutputPathNode(this) { Name = "Output" };
     OutputPath.DefineSymbol();
 }
        protected AstSingleInTransformationNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            SingletonPropertyChanged += AstSingleInTransformationNode_SingletonPropertyChanged;
        }
		public override void CloneInto(IFrameworkItem targetItem, Dictionary<IFrameworkItem, IFrameworkItem> cloneMapping)
		{
			base.CloneInto(targetItem, cloneMapping);
			if (targetItem == null || !typeof(AstMeasureGroupNode).IsAssignableFrom(targetItem.GetType()))
			{
				throw new ArgumentException("Provided target node is not of the correct type.");
			}
		}
Example #7
0
        public AstTableCloneNode(IFrameworkItem parentItem)
            : base(parentItem)
        {
            _baseTableColumnsToCloneColumns = new Dictionary<AstTableColumnBaseNode, AstTableColumnBaseNode>();

            InitializeAstNode();
            SingletonPropertyChanged += AstTableNode_SingletonPropertyChanged;
        }
        public AstAttributeRelationshipNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            _attributes = new VulcanCollection<AstNamedNode>();
            InitializeAstNode();

            SingletonPropertyChanged += AstAttributeRelationshipNode_SingletonPropertyChanged;
        }
Example #9
0
 public ParserContext(XElement element, IFrameworkItem parentFrameworkItem, ITemplate currentTemplate, BimlFile bimlFile, UnboundReferences unboundReferences, LanguageSettings languageSettings)
 {
     XElement = element;
     FrameworkItem = parentFrameworkItem;
     Template = currentTemplate;
     BimlFile = bimlFile;
     UnboundReferences = unboundReferences;
     LanguageSettings = languageSettings;
 }
Example #10
0
        public AstRootNode(IFrameworkItem parentItem) : base(parentItem)
        {
            Items = new VulcanCollection<IFrameworkItem>();
            SymbolTable = new SymbolTable(this);

            InitializeAstNode();

            CollectionPropertyChanged += AstRootNode_CollectionPropertyChanged;
        }
Example #11
0
 public BindingItem(PropertyInfo boundProperty, XObject xmlObject, string xmlValue, IFrameworkItem parentItem, BimlFile bimlFile, ITemplateInstance templateInstance)
 {
     BoundProperty = boundProperty;
     XObject = xmlObject;
     XValue = xmlValue;
     ParentItem = parentItem;
     BimlFile = bimlFile;
     TemplateInstance = templateInstance;
 }
Example #12
0
        public AstTableNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            _dataItems = new VulcanCollection<AstNamedNode>();
            EmitVersionNumber = true;
            InitializeAstNode();

            CollectionPropertyChanged += AstTableNode_CollectionPropertyChanged;
        }
Example #13
0
 public VulcanValidationItem(IFrameworkItem invalidAstNode, string propertyName, Severity severity, ValidationCode validationCode, string message, string recommendation)
 {
     InvalidItem = invalidAstNode;
     PropertyName = propertyName;
     Severity = severity;
     ValidationCode = validationCode;
     Message = message;
     Recommendation = recommendation;
 }
Example #14
0
        public AstTableIndexNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            _items = new VulcanCollection<AstNode>();

            InitializeAstNode();

            CollectionPropertyChanged += AstTableIndexNode_CollectionPropertyChanged;
        }
        public AstEtlFragmentReferenceNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            foreach (var column in Outputs)
            {
                DefinedColumns.Add(new AstTransformationColumnNode(this) { ColumnName = column.DestinationPathColumnName });
            }
        }
Example #16
0
        public AstAttributeNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            _columns = new VulcanCollection<AstAttributeColumnNode>();

            InitializeAstNode();

            SingletonPropertyChanged += AstAttributeNode_SingletonPropertyChanged;
            CollectionPropertyChanged += AstAttributeNode_CollectionPropertyChanged;
        }
Example #17
0
        public AstSortNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            OutputPath = new AstDataflowOutputPathNode(this) { Name = "Output", SsisName = OutputSsisName };
            OutputPath.DefineSymbol();

            PreferredOutputPath = OutputPath;

            StaticOutputPaths.Add(OutputPath);
        }
Example #18
0
        public AstConditionalSplitNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            ErrorPath = new AstDataflowOutputPathNode(this) { Name = "Error", SsisName = ErrorSsisName };

            ErrorPath.DefineSymbol();

            DefaultOutputPath = new AstDataflowOutputPathNode(this) { Name = "DefaultOutput", SsisName = "DefaultOutput" };

            PreferredOutputPath = DefaultOutputPath;

            StaticOutputPaths.Add(ErrorPath);
        }
Example #19
0
        public AstLateArrivingLookupNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            OutputPath = new AstDataflowOutputPathNode(this) { Name = "Output", SsisName = OutputSsisName };

            OutputPath.DefineSymbol();

            PreferredOutputPath = OutputPath;

            StaticOutputPaths.Add(OutputPath);

            foreach (var column in Outputs)
            {
                DefinedColumns.Add(new AstTransformationColumnNode(this) { ColumnName = column.LocalColumnName });
            }
        }
Example #20
0
        public AstOleDBCommandNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            OutputPath = new AstDataflowOutputPathNode(this) { Name = "Output", SsisName = OutputSsisName };
            ErrorPath = new AstDataflowOutputPathNode(this) { Name = "Error", SsisName = ErrorSsisName };

            OutputPath.DefineSymbol();
            ErrorPath.DefineSymbol();

            PreferredOutputPath = OutputPath;

            StaticOutputPaths.Add(OutputPath);
            StaticOutputPaths.Add(ErrorPath);

            // TODO: Results?
            ////foreach (var column in Mappings)
            ////{
            ////    DefinedColumns.Add(new AstTransformationColumnNode(this) { ColumnName = column.DestinationName });
            ////}
        }
Example #21
0
        public static Dictionary<IFrameworkItem, IFrameworkItem> LoadDefinitionMappings(IFrameworkItem parentItem, IFrameworkItem subitem)
        {
            var definitionMappings = new Dictionary<IFrameworkItem, IFrameworkItem>();

            var remainingParentItemDefinedNodes = new Stack<IFrameworkItem>();
            var remainingSubItemDefinedNodes = new Stack<IFrameworkItem>();

            remainingParentItemDefinedNodes.Push(parentItem);
            remainingSubItemDefinedNodes.Push(subitem);

            while (remainingSubItemDefinedNodes.Count > 0)
            {
                var currentParentItemDefinedNode = remainingParentItemDefinedNodes.Pop();
                var currentSubItemDefinedNode = remainingSubItemDefinedNodes.Pop();

                definitionMappings[currentParentItemDefinedNode] = currentSubItemDefinedNode;

                var parentItemChildDefinedNodes = currentParentItemDefinedNode.DefinedAstNodes();
                var subItemChildDefinedNodes = currentSubItemDefinedNode.DefinedAstNodes();

                foreach (var childType in new HashSet<Type>(subItemChildDefinedNodes.Select(item => item.GetType())))
                {
                    var typedSubItemChildDefinedNodes = subItemChildDefinedNodes.Where(item => item.GetType() == childType).ToList();
                    var typedParentItemChildDefinedNodes = parentItemChildDefinedNodes.Where(item => item.GetType() == childType).ToList();
                    Assert.AreEqual(typedParentItemChildDefinedNodes.Count, typedSubItemChildDefinedNodes.Count, String.Format(CultureInfo.InvariantCulture, "Mismatch in {0} count of children of type {1} - {2} != {3}", currentSubItemDefinedNode, childType.Name, typedParentItemChildDefinedNodes.Count, typedSubItemChildDefinedNodes.Count));

                    for (int i = 0; i < typedSubItemChildDefinedNodes.Count; i++)
                    {
                        remainingParentItemDefinedNodes.Push(typedParentItemChildDefinedNodes[i]);
                        remainingSubItemDefinedNodes.Push(typedSubItemChildDefinedNodes[i]);
                    }
                }
            }

            return definitionMappings;
        }
Example #22
0
        public AstDerivedColumnListNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            OutputPath = new AstDataflowOutputPathNode(this) { Name = "Output", SsisName = OutputSsisName };
            ErrorPath = new AstDataflowOutputPathNode(this) { Name = "Error", SsisName = ErrorSsisName };

            OutputPath.DefineSymbol();
            ErrorPath.DefineSymbol();

            PreferredOutputPath = OutputPath;

            StaticOutputPaths.Add(OutputPath);
            StaticOutputPaths.Add(ErrorPath);

            foreach (var column in Columns)
            {
                if (!column.ReplaceExisting)
                {
                    DefinedColumns.Add(new AstTransformationColumnNode(this) { ColumnName = column.Name });
                }
            }
        }
Example #23
0
        public AstLookupNode(IFrameworkItem parentAstNode)
            : base(parentAstNode)
        {
            InitializeAstNode();

            MatchPath = new AstDataflowOutputPathNode(this) { Name = "Match", SsisName = MatchSsisName };
            NoMatchPath = new AstDataflowOutputPathNode(this) { Name = "NoMatch", SsisName = NoMatchSsisName };
            ErrorPath = new AstDataflowOutputPathNode(this) { Name = "Error", SsisName = ErrorSsisName };

            MatchPath.DefineSymbol();
            NoMatchPath.DefineSymbol();
            ErrorPath.DefineSymbol();

            PreferredOutputPath = MatchPath;

            StaticOutputPaths.Add(MatchPath);
            StaticOutputPaths.Add(NoMatchPath);
            StaticOutputPaths.Add(ErrorPath);

            foreach (var column in Outputs)
            {
                DefinedColumns.Add(new AstTransformationColumnNode(this) { ColumnName = column.LocalColumnName });
            }
        }
Example #24
0
 public AstStoredProcColumnNode(IFrameworkItem parentAstNode) : base(parentAstNode)
 {
     InitializeAstNode();
 }
Example #25
0
 public AstTermLookupColumnNode(IFrameworkItem parentAstNode) : base(parentAstNode)
 {
     InitializeAstNode();
 }
Example #26
0
 public bool IsRootCollectionObject(IFrameworkItem frameworkItem)
 {
     return(GetRootCollectionName(frameworkItem) != null);
 }
Example #27
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstTransformationColumnNode(parentItem));
 }
Example #28
0
 public AstTaskflowOutputPathNode(IFrameworkItem parentAstNode) : base(parentAstNode)
 {
     InitializeAstNode();
 }
Example #29
0
 public AstTableIndexLeafNode(IFrameworkItem parentAstNode) : base(parentAstNode)
 {
     InitializeAstNode();
 }
Example #30
0
 protected AstTemplateNode(IFrameworkItem parentItem)
     : base(parentItem)
 {
     InitializeAstNode();
     UnboundReferences = new UnboundReferences();
 }
Example #31
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstTaskTemplateNode(parentItem));
 }
        public override void CloneInto(IFrameworkItem targetItem, Dictionary<IFrameworkItem, IFrameworkItem> cloneMapping)
        {
            base.CloneInto(targetItem, cloneMapping);
            if (targetItem == null || !typeof(AstPackageTemplateNode).IsAssignableFrom(targetItem.GetType()))
            {
                throw new ArgumentException("Provided target node is not of the correct type.");
            }
            var castedTargetItem = (AstPackageTemplateNode)targetItem;
            if (_package == null)
            {
                castedTargetItem._package = null;
            }
            else if (cloneMapping.ContainsKey(_package))
            {
                castedTargetItem._package = (VulcanEngine.IR.Ast.Task.AstPackageBaseNode)cloneMapping[_package];
                _package.CloneInto(cloneMapping[_package], cloneMapping);
            }
            else
            {
                castedTargetItem._package = _package;
            }

        }
 public override IFrameworkItem Clone(IFrameworkItem parentItem)
 {
     return Clone(parentItem, new Dictionary<IFrameworkItem, IFrameworkItem>());
 }
Example #34
0
        public override void CloneInto(IFrameworkItem targetItem, Dictionary <IFrameworkItem, IFrameworkItem> cloneMapping)
        {
            base.CloneInto(targetItem, cloneMapping);
            if (targetItem == null || !typeof(AstRootNode).IsAssignableFrom(targetItem.GetType()))
            {
                throw new ArgumentException("Provided target node is not of the correct type.");
            }
            var castedTargetItem = (AstRootNode)targetItem;

            foreach (var item in _connections)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._connections.Add((VulcanEngine.IR.Ast.Connection.AstConnectionNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _tables)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._tables.Add((VulcanEngine.IR.Ast.Table.AstTableBaseNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _dimensions)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._dimensions.Add((VulcanEngine.IR.Ast.Dimension.AstDimensionNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _facts)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._facts.Add((VulcanEngine.IR.Ast.Fact.AstFactNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _packages)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._packages.Add((VulcanEngine.IR.Ast.Task.AstPackageBaseNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _schemas)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._schemas.Add((VulcanEngine.IR.Ast.Table.AstSchemaNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _principals)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._principals.Add((VulcanEngine.IR.Ast.Table.AstPrincipalNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _persistentVariables)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._persistentVariables.Add((VulcanEngine.IR.Ast.PersistentVariables.AstPersistentVariableNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }

            foreach (var item in _templates)
            {
                IFrameworkItem candidate = cloneMapping[item];
                castedTargetItem._templates.Add((VulcanEngine.IR.Ast.AstTemplateNode)candidate);
                item.CloneInto(candidate, cloneMapping);
            }
        }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return new AstIsNullPatcherNode(parentItem);
 }
 public AstRetryContainerTaskNode(IFrameworkItem parentItem)
     : base(parentItem)
 {
     InitializeAstNode();
 }
Example #37
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstPackageBaseNode(parentItem));
 }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstTermLookupNode(parentItem));
 }
Example #39
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     throw new NotSupportedException("Cannot clone abstract IFrameworkElement class.  You are missing a Clone method on a non-abstract derived type.");
 }
        private static List <AstTransformationNode> CreateScdWorkflowFragment(AstTableNode targetTable, IFrameworkItem parentItem, AstDataflowOutputPathNode outputPath)
        {
            var workflowFragment = new List <AstTransformationNode>();

            AstTableColumnBaseNode lateArrivingStatusColumn = targetTable.Columns.FirstOrDefault(item => item.Name == "_IsLate");

            var scd = new AstSlowlyChangingDimensionNode(parentItem);

            scd.Name                       = Utility.NameCleanerAndUniqifier(targetTable.Name + "_scd");
            scd.Connection                 = targetTable.Connection;
            scd.CurrentRowWhere            = "[_scdFrom] IS NOT NULL AND [_scdFrom] IS NULL";
            scd.EnableInferredMember       = targetTable.LateArriving;
            scd.FailOnFixedAttributeChange = true;
            scd.FailOnLookupFailure        = false;
            scd.IncomingRowChangeType      = 1;
            scd.InferredMemberIndicator    = lateArrivingStatusColumn;

            // TODO:
            foreach (var column in targetTable.Columns)
            {
                if (column.IsAssignable && !column.IsAutoGenerated)
                {
                    ScdColumnMappingType mappingType;
                    switch (column.ScdType)
                    {
                    case ScdType.Error:
                        mappingType = ScdColumnMappingType.FixedAttribute;
                        break;

                    case ScdType.Historical:
                        mappingType = ScdColumnMappingType.HistoricalAttribute;
                        break;

                    case ScdType.Key:
                        mappingType = ScdColumnMappingType.Key;
                        break;

                    case ScdType.Other:
                        mappingType = ScdColumnMappingType.Other;
                        break;

                    case ScdType.Update:
                        mappingType = ScdColumnMappingType.ChangingAttribute;
                        break;

                    default:
                        mappingType = ScdColumnMappingType.Other;
                        break;
                    }

                    scd.Mappings.Add(new AstScdTypeColumnMappingNode(scd)
                    {
                        MappingType = mappingType, QueryColumnName = column.Name
                    });
                }
            }

            scd.Query = TableLowerer.EmitSelectAllStatement(targetTable);
            if (outputPath != null)
            {
                scd.InputPath = new AstDataflowMappedInputPathNode(scd)
                {
                    OutputPath = outputPath
                };
            }

            workflowFragment.Add(scd);

            // Late Arriving Path
            if (targetTable.LateArriving)
            {
                BuildLateArrivingPath(targetTable, parentItem, workflowFragment, scd.InferredMemberPath);
            }

            // Change Path
            BuildChangePath(targetTable, parentItem, workflowFragment, scd.ChangingAttributePath);

            // Historical Path
            var historicalOutput = BuildHistoricalSubpath(targetTable, parentItem, workflowFragment, scd.HistoricalAttributePath);

            // Union Historical and New Paths
            var insertUnionAll = new AstUnionAllNode(parentItem)
            {
                Name = Utility.NameCleanerAndUniqifier(targetTable.Name + "_InsertUnionAll")
            };

            insertUnionAll.InputPaths.Add(new AstDataflowMappedInputPathNode(insertUnionAll)
            {
                OutputPath = scd.NewPath
            });
            insertUnionAll.InputPaths.Add(new AstDataflowMappedInputPathNode(insertUnionAll)
            {
                OutputPath = historicalOutput
            });
            workflowFragment.Add(insertUnionAll);

            // Insert Path
            BuildInsertPath(targetTable, parentItem, workflowFragment, insertUnionAll.OutputPath);

            return(workflowFragment);
        }
Example #41
0
 public AstMeasureGroupNode(IFrameworkItem parentAstNode) : base(parentAstNode)
 {
     InitializeAstNode();
 }
Example #42
0
        public AstConnectionNode(IFrameworkItem parentAstNode) : base(parentAstNode)
        {
            InitializeAstNode();

            SingletonPropertyChanged += AstConnectionNode_SingletonPropertyChanged;
        }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstDataflowColumnMappingNode(parentItem));
 }
Example #44
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstDataflowOutputPathNode(parentItem));
 }
 public override IFrameworkItem Clone(IFrameworkItem parentItem)
 {
     return(Clone(parentItem, new Dictionary <IFrameworkItem, IFrameworkItem>()));
 }
Example #46
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstIsNullPatcherNode(parentItem));
 }
 public override IFrameworkItem Clone(IFrameworkItem parentItem, Dictionary <IFrameworkItem, IFrameworkItem> cloneMapping)
 {
     SymbolTable.GetSourceToCloneDefinitionMappings(this, parentItem, cloneMapping);
     CloneInto(cloneMapping[this], cloneMapping);
     return(cloneMapping[this]);
 }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstMultipleColumnDimensionReferenceNode(parentItem));
 }
Example #49
0
 public AstPackageTemplateInstanceNode(IFrameworkItem parentItem)
     : base(parentItem)
 {
     InitializeAstNode();
 }
Example #50
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstRootNode(parentItem));
 }
Example #51
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstTableColumnTableReferenceNode(parentItem));
 }
        private static AstDataflowOutputPathNode BuildHistoricalSubpath(AstTableNode targetTable, IFrameworkItem parentItem, List <AstTransformationNode> workflowFragment, AstDataflowOutputPathNode scdHistoricalPath)
        {
            var historicalTransform = new AstDerivedColumnListNode(parentItem);

            historicalTransform.InputPath = new AstDataflowMappedInputPathNode(historicalTransform)
            {
                OutputPath = scdHistoricalPath
            };
            historicalTransform.Name = Utility.NameCleanerAndUniqifier(targetTable.Name + "_HistoricalDerivedColumns");
            historicalTransform.Columns.Add(new AstDerivedColumnNode(historicalTransform)
            {
                Name              = "_scdTo",
                Expression        = "(DT_DBTIMESTAMP2,7)(@[System::StartTime])",
                Scale             = 7,
                DerivedColumnType = ColumnType.DateTime2,
                ReplaceExisting   = false
            });
            workflowFragment.Add(historicalTransform);

            var historicalCommand = new AstOleDBCommandNode(parentItem)
            {
                Name       = Utility.NameCleanerAndUniqifier(targetTable.Name + "_HistoricalCommand"),
                Connection = targetTable.Connection
            };

            historicalCommand.Query = new AstTransformationMappedQueryNode(historicalCommand);

            var historicalSetColumnValueMappings   = new List <TableColumnValueMapping>();
            var historicalWhereColumnValueMappings = new List <TableColumnValueMapping>();

            historicalCommand.Query.Mappings.Add(new AstDataflowColumnMappingNode(historicalCommand)
            {
                SourceName = "_scdTo", TargetName = "Param_0"
            });
            historicalSetColumnValueMappings.Add(new TableColumnValueMapping("_scdTo", "?", MappingOperator.Assign));

            historicalWhereColumnValueMappings.Add(new TableColumnValueMapping("_scdTo", "NULL", MappingOperator.CompareIs));
            int historicalIndex = 1;

            foreach (var keyColumn in targetTable.PreferredKey.Columns)
            {
                historicalCommand.Query.Mappings.Add(new AstDataflowColumnMappingNode(historicalCommand)
                {
                    SourceName = keyColumn.Column.Name, TargetName = String.Format(CultureInfo.InvariantCulture, "Param_{0}", historicalIndex++)
                });
                historicalWhereColumnValueMappings.Add(new TableColumnValueMapping(keyColumn.Column.Name, "?", MappingOperator.CompareEqual));
            }

            historicalCommand.Query.Body = TableLowerer.EmitUpdateStatement(targetTable, historicalSetColumnValueMappings, historicalWhereColumnValueMappings);
            historicalCommand.ValidateExternalMetadata = false;
            workflowFragment.Add(historicalCommand);

            return(historicalCommand.OutputPath);
        }
Example #53
0
        public static AstExecuteSqlTaskNode CreateInsertExecuteSql(AstTableStaticSourceNode staticSource, IFrameworkItem insertParent, AstTableNode insertTargetTable)
        {
            var executeSql = new AstExecuteSqlTaskNode(insertParent)
                                 {
                                     Connection = insertTargetTable.Connection,
                                     ExecuteDuringDesignTime = false,
                                     Name = Utility.NameCleanerAndUniqifier(insertTargetTable + "_Insert"),
                                 };

            executeSql.Query = new AstExecuteSqlQueryNode(executeSql)
                                   {
                                       Body = GetInsertStatements(insertTargetTable, staticSource),
                                       QueryType = QueryType.Standard
                                   };
            return executeSql;
        }
Example #54
0
 public AstPackageBaseNode(IFrameworkItem parentItem)
     : base(parentItem)
 {
     InitializeAstNode();
 }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return new AstFactTableColumnNode(parentItem);
 }
 public AstEtlFragmentPathColumnMappingNode(IFrameworkItem parentItem)
     : base(parentItem)
 {
     InitializeAstNode();
 }
 public override IFrameworkItem Clone(IFrameworkItem parentItem, Dictionary<IFrameworkItem, IFrameworkItem> cloneMapping)
 {
     SymbolTable.GetSourceToCloneDefinitionMappings(this, parentItem, cloneMapping);
     CloneInto(cloneMapping[this], cloneMapping);
     return cloneMapping[this];
 }
Example #58
0
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return(new AstVariableParameterMappingQueryNode(parentItem));
 }
 public override IFrameworkItem CloneHusk(IFrameworkItem parentItem)
 {
     return new AstPackageTemplateNode(parentItem);
 }
Example #60
0
 public AstRowCountNode(IFrameworkItem parentItem) : base(parentItem)
 {
     InitializeAstNode();
 }