public void DimensionCreation() { string solutionFile = @"BISolution.xml"; BISolution solution = new BISolution(solutionFile); XmlReader solutionXML = XmlReader.Create(solutionFile); XmlSerializer ser = new XmlSerializer(typeof(SOLUTION)); this.s = (SOLUTION)ser.Deserialize(solutionXML); this.dimension = this.s.CUBE.getDimensionByName("USER"); }
//TODO get Dts.Runtime dll for reference public PACKAGE_DIM(DIMENSION d) : base(d) { this.packageType = "DIM"; this.Name = this.tableName(); this.addConnection("Source", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("PSA").NAME); this.addConnection("RUN", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("RUN").NAME); this.addConnection("MATCH", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("MATCH").NAME); this.addConnection("META", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("META").NAME); this.addConnection("DIM", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("DIM").NAME); this.addVariable("Audit::RowsMatched"); this.addVariable("Audit::RowsInserted"); this.addVariable("Audit::RowsUpdated"); this.addVariable("Audit::RowsDeleted"); this.addVariable("Audit::LastRunDate", new DateTime()); // Get last run date to compare against active date. EzExecuteSQLTask GetLastRunDate = new EzExecuteSQLTask(this); GetLastRunDate.Name = "Get Last Run Date"; //TODO create Run Log Table //TODO write result to variable GetLastRunDate.SqlStatementSource = "select max(rundate) as maxRunDate from run_log"; GetLastRunDate.Connection = this.Conns["RUN"]; GetLastRunDate. foreach (SOURCEOBJECT so in this.dim.MAPPING.SOURCEOBJECTS) { DimDataFlow UpdateDimension = new DimDataFlow(this, this, so ); UpdateDimension.Name = String.Format("Update Dimension - {0} - {1}", so.DATASOURCENAME, so.DATAOBJECTNAME); UpdateDimension.AttachTo(GetLastRunDate); //TODO add reset logic to logger this.addLogging(UpdateDimension.Name); } this.SaveToFile(this.fileName()); this.addConfigurations(); }