public PACKAGE_STAGE(DATAOBJECT d)
            : base(d)
        {
            this.packageType = "STAGE";

            this.Name = this.tableName("STAGE");

            this.addConnection("Commercial_STG", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("STAGE").NAME);
            this.addConnection("Commercial_PSA", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("PSA").NAME);
            this.addConnection("Commercial_RUN", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("RUN").NAME);
            this.addConnection("MATCH", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("MATCH").NAME);
            this.addConnection("Commercial_META", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("META").NAME);
            this.addConnection("Source", this.d.ds.SERVERNAME, this.d.ds.DATABASENAME);

            this.addVariable("Audit::RowsMatched");
            this.addVariable("Audit::RowsInserted");
            this.addVariable("Audit::RowsUpdated");
            this.addVariable("Audit::RowsDeleted");

            //Clear stage table for clean full load of source data
            EzExecuteSQLTask TruncateStageTable = new EzExecuteSQLTask(this);
            TruncateStageTable.Name = "Truncate Stage Table";
            TruncateStageTable.SqlStatementSource = "truncate table " + this.tableName("STAGE");
            TruncateStageTable.Connection = this.Conns["Commercial_STG"];

            EzDataFlow ExtractAllRecords = new StageDataFlow(this, this);
            ExtractAllRecords.Name = "Extract All Records";
            ExtractAllRecords.AttachTo(TruncateStageTable);

            this.SaveToFile(this.fileName());
            this.addConfigurations();
            this.addLogging(ExtractAllRecords.Name);
        }
        public PACKAGE_FACT(MAPPING m)
            : base(m)
        {
            this.packageType = "FACT";

            this.Name = String.Format("Fact - {0}", this.m.NAME);

              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.addConnection("FACT", this.t.SSMS.SERVERNAME, this.t.getDatabaseByLayer("FACT").NAME);

            this.addVariable("Audit::RowsMatched");
            this.addVariable("Audit::RowsInserted");
            this.addVariable("Audit::RowsUpdated");
            this.addVariable("Audit::RowsDeleted");

            EzExecuteSQLTask DeleteFactRows = new EzExecuteSQLTask(this);
            DeleteFactRows.Name = "Delete Fact Rows";
            //TODO correct query
            DeleteFactRows.SqlStatementSource = "select 1";
            DeleteFactRows.Connection = this.Conns["FACT"];

            //TODO foreach unionable source object, create data flow and attach
            EzDataFlow InsertFacts = new FactDataFlow(this, this, this.m.SOURCEOBJECTS[0]);
              	InsertFacts.Name = "Insert Facts";
            InsertFacts.AttachTo(DeleteFactRows);

            this.SaveToFile(this.fileName());
            this.addConfigurations();
            this.addLogging(InsertFacts.Name);
        }
        //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();
        }