/// <summary>
        /// Upgrade from SSIS 2008 to 2012/2014
        /// </summary>
        /// <param name="pipelineVersion">components pipeline verion</param>
        public override void PerformUpgrade(int pipelineVersion)
        {
            try
            {
                if (LineageMapping.NeedsMapping())
                {
                    InitProperties(false);

                    foreach (ColumnConfig config in _IsagCustomProperties.ColumnConfigList)
                    {
                        if (string.IsNullOrEmpty(config.CustomId))
                        {
                            config.CustomId = Guid.NewGuid().ToString();
                        }
                        AddInputColumnCustomProperty(config.InputColumnName, config.CustomId, LineageMapping.IdPropertyName);
                    }

                    LineageMapping.UpdateInputIdProperties(this.ComponentMetaData, _IsagCustomProperties);
                    _IsagCustomProperties.Save(this.ComponentMetaData);
                }

                DtsPipelineComponentAttribute attr =
                    (DtsPipelineComponentAttribute)Attribute.GetCustomAttribute(this.GetType(), typeof(DtsPipelineComponentAttribute), false);
                ComponentMetaData.Version = attr.CurrentVersion;
            }
            catch (Exception ex)
            {
                bool cancel = false;
                this.ComponentMetaData.FireError(0, "DataConverter Upgrade", ex.ToString(), "", 0, out cancel);
                throw (ex);
            }
        }
Пример #2
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="inputColumnName">input column name</param>
        /// <param name="dataTypeInput">input datatype</param>
        /// <param name="inputColumn">SSIS input column</param>
        public ColumnConfig(string inputColumnName, string dataTypeInput, IDTSInputColumn100 inputColumn)
        {
            _insert = false;
            _update = false;
            _key    = false;

            _inputColumnName  = inputColumnName;
            _outputColumnName = "";

            _default  = "";
            _function = "";

            _dataTypeInput     = dataTypeInput;
            _dataTypeOutput    = "";
            _dataTypeOutputNet = "";

            _isOutputPrimaryKey = false;
            _allowOutputDbNull  = false;
            _isOutputAutoId     = false;

            _inputColumnId = inputColumn.ID;

            //ID Mapping
            _customId = Guid.NewGuid().ToString();
            LineageMapping.SetIdProperty(_customId, inputColumn.CustomPropertyCollection);
        }
        /// <summary>
        /// Reiniitalized the components metadata
        /// </summary>
        public override void ReinitializeMetaData()
        {
            base.ReinitializeMetaData();
            this.ComponentMetaData.RemoveInvalidInputColumns();
            InitProperties(false);
            LineageMapping.UpdateInputIdProperties(ComponentMetaData, _IsagCustomProperties);

            _IsagCustomProperties.RebuildMappings(ComponentMetaData, _events);
        }
        /// <summary>
        /// Validates the component metadata
        /// </summary>
        /// <returns>Is component configuration valid?</returns>
        public override DTSValidationStatus Validate()
        {
            InitProperties(false);
            LineageMapping.UpdateInputIdProperties(ComponentMetaData, _IsagCustomProperties);

            DTSValidationStatus status = base.Validate();

            if (status != DTSValidationStatus.VS_ISVALID)
            {
                return(status);
            }

            if (!_IsagCustomProperties.IsValid(ComponentMetaData, _events))
            {
                return(DTSValidationStatus.VS_NEEDSNEWMETADATA);
            }

            if (!this.ComponentMetaData.AreInputColumnsValid)
            {
                return(DTSValidationStatus.VS_NEEDSNEWMETADATA);
            }

            return(DTSValidationStatus.VS_ISVALID);
        }