From bac1189dd71e72bdccf91ead3441aefb18481020 Mon Sep 17 00:00:00 2001 From: NileshGhodekar Date: Wed, 19 Jul 2017 06:51:38 -0700 Subject: [PATCH] Fix for preserving the order of WAL value expressions. --- ChangeLog.md | 8 +++++ src/MIMConfigDocumenter/Documenter.cs | 15 ++++++++-- .../MIMServicePolicyDocumenter.cs | 30 +++++++++++-------- src/VersionInfo.cs | 4 +-- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7b22689..e9c6baf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,14 @@ All notable changes to MIMConfigDocumenter project will be documented in this fi ------------ +### Version 1.17.0719.0 + +#### Fixed + +* In the MIMWAL activity configuration, Value Expressions information gets reordered alphabetically. + +------------ + ### Version 1.17.0610.0 #### Changed diff --git a/src/MIMConfigDocumenter/Documenter.cs b/src/MIMConfigDocumenter/Documenter.cs index 5bf1cd7..cf7f7da 100644 --- a/src/MIMConfigDocumenter/Documenter.cs +++ b/src/MIMConfigDocumenter/Documenter.cs @@ -640,9 +640,18 @@ protected static void SetHtmlTableRowVisibilityStatus(DataSet diffgramDataSet) } else if (!Documenter.IsCumulativeRowStateChanged(row, i)) { - var dataRelationName = string.Format(CultureInfo.InvariantCulture, "DataRelation{0}{1}", i, i + 1); - var parentRow = row.GetParentRow(dataRelationName); - row[Documenter.HtmlTableRowVisibilityStatusColumn] = parentRow[Documenter.HtmlTableRowVisibilityStatusColumn]; + try + { + var dataRelationName = string.Format(CultureInfo.InvariantCulture, "DataRelation{0}{1}", i, i + 1); + var parentRow = row.GetParentRow(dataRelationName); + row[Documenter.HtmlTableRowVisibilityStatusColumn] = parentRow[Documenter.HtmlTableRowVisibilityStatusColumn]; + } + catch (DataException e) + { + var rowString = (row != null) ? string.Join("|", row.ItemArray) : string.Empty; + var errorMsg = e.Message + " Data Row: " + rowString + e.StackTrace; + Logger.Instance.WriteError(errorMsg); + } } } diff --git a/src/MIMConfigDocumenter/MIMServicePolicyDocumenter.cs b/src/MIMConfigDocumenter/MIMServicePolicyDocumenter.cs index 6e98a22..272d9ee 100644 --- a/src/MIMConfigDocumenter/MIMServicePolicyDocumenter.cs +++ b/src/MIMConfigDocumenter/MIMServicePolicyDocumenter.cs @@ -1474,29 +1474,33 @@ protected void CreateWorkflowActivityDetailsDataSets() var table5 = new DataTable("Workflow Activity WAL Value Expressions") { Locale = CultureInfo.InvariantCulture }; var column15 = new DataColumn("ActivityIndex", typeof(int)); - var column25 = new DataColumn("SectionIndex", typeof(int)); // QueryTable, UpdatesTable, etc... + var column25 = new DataColumn("SectionIndex", typeof(int)); // QueryTable, etc with Allow Null supressed var column35 = new DataColumn("Value Expression"); var column45 = new DataColumn("Target"); + var column55 = new DataColumn("DisplayOrderIndex", typeof(int)); // Display Order Control table5.Columns.Add(column15); table5.Columns.Add(column25); table5.Columns.Add(column35); table5.Columns.Add(column45); + table5.Columns.Add(column55); table5.PrimaryKey = new[] { column15, column25, column35, column45 }; var table6 = new DataTable("Workflow Activity WAL Update Expressions") { Locale = CultureInfo.InvariantCulture }; var column16 = new DataColumn("ActivityIndex", typeof(int)); - var column26 = new DataColumn("SectionIndex", typeof(int)); // QueryTable, UpdatesTable, etc... + var column26 = new DataColumn("SectionIndex", typeof(int)); // UpdatesTable, etc. with Allow Null visible var column36 = new DataColumn("Value Expression"); var column46 = new DataColumn("Target"); var column56 = new DataColumn("Allow Null"); + var column66 = new DataColumn("DisplayOrderIndex", typeof(int)); // Display Order Control table6.Columns.Add(column16); table6.Columns.Add(column26); table6.Columns.Add(column36); table6.Columns.Add(column46); table6.Columns.Add(column56); + table6.Columns.Add(column66); table6.PrimaryKey = new[] { column16, column26, column36, column46 }; this.PilotDataSet = new DataSet("Workflow Activities") { Locale = CultureInfo.InvariantCulture }; @@ -1647,13 +1651,13 @@ protected void FillWorkflowActivityValueExpressions(DataTable activityValueExpre var target = ((IEnumerable)hashtable.XPathEvaluate(".//Key[String = '" + expressionIndex + ":1']/parent::node()/text()")).Cast().FirstOrDefault(); var allowNull = ((IEnumerable)hashtable.XPathEvaluate(".//Key[String = '" + expressionIndex + ":2']/parent::node()/text()")).Cast().FirstOrDefault(); - if (activityValueExpressionsTable.Columns.Count == 4) + if (activityValueExpressionsTable.Columns.Count == 5) { - Documenter.AddRow(activityValueExpressionsTable, new object[] { activityIndex, sectionIndex, valueExpression != null ? valueExpression.Value : null, target != null ? target.Value : null }); + Documenter.AddRow(activityValueExpressionsTable, new object[] { activityIndex, sectionIndex, valueExpression != null ? valueExpression.Value : null, target != null ? target.Value : null, expressionIndex }); } else { - Documenter.AddRow(activityValueExpressionsTable, new object[] { activityIndex, sectionIndex, valueExpression != null ? valueExpression.Value : null, target != null ? target.Value : null, allowNull != null ? allowNull.Value : null }); + Documenter.AddRow(activityValueExpressionsTable, new object[] { activityIndex, sectionIndex, valueExpression != null ? valueExpression.Value : null, target != null ? target.Value : null, allowNull != null ? allowNull.Value : null, expressionIndex }); } } } @@ -1737,7 +1741,7 @@ protected void CreateWorkflowActivitySelectedOptionsDiffgramDataSet() { var printTable = Documenter.GetPrintTable(); - // Table 2 + // Table 3 printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 0 }, { "Hidden", true }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 1 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", true } }).Values.Cast().ToArray()); @@ -1783,7 +1787,7 @@ protected void CreateWorkflowActivityMultiValuesDiffgramDataSet() var printTable = Documenter.GetPrintTable(); - // Table 2 + // Table 4 printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 1 }, { "Hidden", true }, { "SortOrder", 1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); @@ -1822,11 +1826,12 @@ protected void CreateWorkflowActivityValueExpressionsDiffgramDataSet() var printTable = Documenter.GetPrintTable(); - // Table 2 + // Table 5 printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 3 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); + printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 4 }, { "Hidden", true }, { "SortOrder", 1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); - this.DiffgramDataSet = new DataSet("Workflow Activity Multi-values") { Locale = CultureInfo.InvariantCulture }; + this.DiffgramDataSet = new DataSet("Workflow Activity Value Expressions") { Locale = CultureInfo.InvariantCulture }; this.DiffgramDataSet.Tables.Add(diffgramTable); this.DiffgramDataSet.Tables.Add(diffgramTable2); this.DiffgramDataSet.Tables.Add(printTable); @@ -1861,12 +1866,13 @@ protected void CreateWorkflowActivityUpdateExpressionsDiffgramDataSet() var printTable = Documenter.GetPrintTable(); - // Table 2 + // Table 6 printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 3 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 4 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); + printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 5 }, { "Hidden", true }, { "SortOrder", 1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast().ToArray()); - this.DiffgramDataSet = new DataSet("Workflow Activity Multi-values") { Locale = CultureInfo.InvariantCulture }; + this.DiffgramDataSet = new DataSet("Workflow Activity Update Expressions") { Locale = CultureInfo.InvariantCulture }; this.DiffgramDataSet.Tables.Add(diffgramTable); this.DiffgramDataSet.Tables.Add(diffgramTable2); this.DiffgramDataSet.Tables.Add(printTable); @@ -2057,7 +2063,7 @@ protected void PrintWorkflowActivityValueExpressionsTable(int activityIndex, int this.DiffgramDataSet = tableSubHeader.Count == 3 ? this.DiffgramDataSets[4] : this.DiffgramDataSets[3]; int currentTableIndex = 1; - var rows = this.DiffgramDataSet.Tables[currentTableIndex].Select("ActivityIndex = " + activityIndex + "AND SectionIndex = " + sectionIndex); + var rows = this.DiffgramDataSet.Tables[currentTableIndex].Select("ActivityIndex = " + activityIndex + "AND SectionIndex = " + sectionIndex, "DisplayOrderIndex ASC"); if (rows.Count() != 0) { var headerTable = Documenter.GetSimpleSettingsHeaderTable(tableHeader, tableSubHeader); diff --git a/src/VersionInfo.cs b/src/VersionInfo.cs index 7c21181..6a7e681 100644 --- a/src/VersionInfo.cs +++ b/src/VersionInfo.cs @@ -22,7 +22,7 @@ internal static class VersionInfo /// Build Number (MMDD) /// Revision (if any on the same day) /// - internal const string Version = "1.17.0610.0"; + internal const string Version = "1.17.0719.0"; /// /// File Version information for the assembly consists of the following four values: @@ -31,6 +31,6 @@ internal static class VersionInfo /// Build Number (MMDD) /// Revision (if any on the same day) /// - internal const string FileVersion = "1.17.0610.0"; + internal const string FileVersion = "1.17.0719.0"; } } \ No newline at end of file