Skip to content

Commit

Permalink
Fix for preserving the order of WAL value expressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
NileshGhodekar committed Jul 19, 2017
1 parent 2ea04f9 commit bac1189
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 17 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions src/MIMConfigDocumenter/Documenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down
30 changes: 18 additions & 12 deletions src/MIMConfigDocumenter/MIMServicePolicyDocumenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -1647,13 +1651,13 @@ protected void FillWorkflowActivityValueExpressions(DataTable activityValueExpre
var target = ((IEnumerable)hashtable.XPathEvaluate(".//Key[String = '" + expressionIndex + ":1']/parent::node()/text()")).Cast<XText>().FirstOrDefault();
var allowNull = ((IEnumerable)hashtable.XPathEvaluate(".//Key[String = '" + expressionIndex + ":2']/parent::node()/text()")).Cast<XText>().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 });
}
}
}
Expand Down Expand Up @@ -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<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 1 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", true } }).Values.Cast<object>().ToArray());
Expand Down Expand Up @@ -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<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 2 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().ToArray());

Expand Down Expand Up @@ -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<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 3 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 4 }, { "Hidden", true }, { "SortOrder", 1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().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);
Expand Down Expand Up @@ -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<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 3 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 4 }, { "Hidden", false }, { "SortOrder", -1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().ToArray());
printTable.Rows.Add((new OrderedDictionary { { "TableIndex", 1 }, { "ColumnIndex", 5 }, { "Hidden", true }, { "SortOrder", 1 }, { "BookmarkIndex", -1 }, { "JumpToBookmarkIndex", -1 }, { "ChangeIgnored", false } }).Values.Cast<object>().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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string Version = "1.17.0610.0";
internal const string Version = "1.17.0719.0";

/// <summary>
/// File Version information for the assembly consists of the following four values:
Expand All @@ -31,6 +31,6 @@ internal static class VersionInfo
/// Build Number (MMDD)
/// Revision (if any on the same day)
/// </summary>
internal const string FileVersion = "1.17.0610.0";
internal const string FileVersion = "1.17.0719.0";
}
}

0 comments on commit bac1189

Please sign in to comment.