Skip to content

Commit

Permalink
[FINETUNING] Support fror unlinked references in Annex.C3 export
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Dec 11, 2023
1 parent c15d0bf commit 0771926
Show file tree
Hide file tree
Showing 144 changed files with 680 additions and 526 deletions.
20 changes: 10 additions & 10 deletions CDP4Common/AutoGenDto/ActionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()
{
var dictionary = new Dictionary<string, IEnumerable<Guid>>();

if (this.Actionee != default)
if (this.Actionee != null)
{
dictionary.Add("Actionee", new [] { this.Actionee });
}

dictionary.Add("ApprovedBy", this.ApprovedBy);

if (this.Author != default)
if (this.Author != null)
{
dictionary.Add("Author", new [] { this.Author });
}
Expand All @@ -136,12 +136,12 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}

if (this.PrimaryAnnotatedThing != default)
if (this.PrimaryAnnotatedThing != null)
{
dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value });
}
Expand Down Expand Up @@ -179,9 +179,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Actionee":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Actionee property is not allowed.");
errors.Add($"Removed reference '{id}' from Actionee property results in inconsistent ActionItem.");
result = false;
}
result = false;
break;

case "ApprovedBy":
Expand All @@ -191,9 +191,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Author":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Author property is not allowed.");
errors.Add($"Removed reference '{id}' from Author property results in inconsistent ActionItem.");
result = false;
}
result = false;
break;

case "Category":
Expand All @@ -215,9 +215,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent ActionItem.");
result = false;
}
result = false;
break;

case "PrimaryAnnotatedThing":
Expand Down
4 changes: 2 additions & 2 deletions CDP4Common/AutoGenDto/ActualFiniteState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "PossibleState":
if (addModelErrors && this.PossibleState.Count == 1)
{
errors.Add($"Remove reference '{id}' from PossibleState property is not allowed.");
errors.Add($"Removing reference '{id}' from PossibleState property results in inconsistent ActualFiniteState.");
result = false;
}
result = false;
this.PossibleState.Remove(id);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions CDP4Common/AutoGenDto/ActualFiniteStateList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludeOption", this.ExcludeOption);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}
Expand Down Expand Up @@ -220,9 +220,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent ActualFiniteStateList.");
result = false;
}
result = false;
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions CDP4Common/AutoGenDto/AndExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Term":
if (addModelErrors && this.Term.Count == 1)
{
errors.Add($"Remove reference '{id}' from Term property is not allowed.");
errors.Add($"Removing reference '{id}' from Term property results in inconsistent AndExpression.");
result = false;
}
result = false;
this.Term.Remove(id);
break;
}
Expand Down
12 changes: 6 additions & 6 deletions CDP4Common/AutoGenDto/Approval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()
{
var dictionary = new Dictionary<string, IEnumerable<Guid>>();

if (this.Author != default)
if (this.Author != null)
{
dictionary.Add("Author", new [] { this.Author });
}
Expand All @@ -118,7 +118,7 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}
Expand Down Expand Up @@ -152,9 +152,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Author":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Author property is not allowed.");
errors.Add($"Removed reference '{id}' from Author property results in inconsistent Approval.");
result = false;
}
result = false;
break;

case "ExcludedDomain":
Expand All @@ -168,9 +168,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent Approval.");
result = false;
}
result = false;
break;
}
}
Expand Down
12 changes: 6 additions & 6 deletions CDP4Common/AutoGenDto/BinaryNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.FileType != default)
if (this.FileType != null)
{
dictionary.Add("FileType", new [] { this.FileType });
}

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}
Expand Down Expand Up @@ -159,17 +159,17 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "FileType":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from FileType property is not allowed.");
errors.Add($"Removed reference '{id}' from FileType property results in inconsistent BinaryNote.");
result = false;
}
result = false;
break;

case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent BinaryNote.");
result = false;
}
result = false;
break;
}
}
Expand Down
18 changes: 9 additions & 9 deletions CDP4Common/AutoGenDto/BinaryRelationship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}

dictionary.Add("ParameterValue", this.ParameterValue);

if (this.Source != default)
if (this.Source != null)
{
dictionary.Add("Source", new [] { this.Source });
}

if (this.Target != default)
if (this.Target != null)
{
dictionary.Add("Target", new [] { this.Target });
}
Expand Down Expand Up @@ -165,9 +165,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent BinaryRelationship.");
result = false;
}
result = false;
break;

case "ParameterValue":
Expand All @@ -177,17 +177,17 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Source":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Source property is not allowed.");
errors.Add($"Removed reference '{id}' from Source property results in inconsistent BinaryRelationship.");
result = false;
}
result = false;
break;

case "Target":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Target property is not allowed.");
errors.Add($"Removed reference '{id}' from Target property results in inconsistent BinaryRelationship.");
result = false;
}
result = false;
break;
}
}
Expand Down
18 changes: 9 additions & 9 deletions CDP4Common/AutoGenDto/BinaryRelationshipRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("HyperLink", this.HyperLink);

if (this.RelationshipCategory != default)
if (this.RelationshipCategory != null)
{
dictionary.Add("RelationshipCategory", new [] { this.RelationshipCategory });
}

if (this.SourceCategory != default)
if (this.SourceCategory != null)
{
dictionary.Add("SourceCategory", new [] { this.SourceCategory });
}

if (this.TargetCategory != default)
if (this.TargetCategory != null)
{
dictionary.Add("TargetCategory", new [] { this.TargetCategory });
}
Expand Down Expand Up @@ -196,25 +196,25 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "RelationshipCategory":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from RelationshipCategory property is not allowed.");
errors.Add($"Removed reference '{id}' from RelationshipCategory property results in inconsistent BinaryRelationshipRule.");
result = false;
}
result = false;
break;

case "SourceCategory":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from SourceCategory property is not allowed.");
errors.Add($"Removed reference '{id}' from SourceCategory property results in inconsistent BinaryRelationshipRule.");
result = false;
}
result = false;
break;

case "TargetCategory":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from TargetCategory property is not allowed.");
errors.Add($"Removed reference '{id}' from TargetCategory property results in inconsistent BinaryRelationshipRule.");
result = false;
}
result = false;
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions CDP4Common/AutoGenDto/Book.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}
Expand Down Expand Up @@ -199,9 +199,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent Book.");
result = false;
}
result = false;
break;
}
}
Expand Down
20 changes: 10 additions & 10 deletions CDP4Common/AutoGenDto/ChangeProposal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ApprovedBy", this.ApprovedBy);

if (this.Author != default)
if (this.Author != null)
{
dictionary.Add("Author", new [] { this.Author });
}

dictionary.Add("Category", this.Category);

if (this.ChangeRequest != default)
if (this.ChangeRequest != null)
{
dictionary.Add("ChangeRequest", new [] { this.ChangeRequest });
}
Expand All @@ -115,12 +115,12 @@ public override IDictionary<string, IEnumerable<Guid>> GetReferenceProperties()

dictionary.Add("ExcludedPerson", this.ExcludedPerson);

if (this.Owner != default)
if (this.Owner != null)
{
dictionary.Add("Owner", new [] { this.Owner });
}

if (this.PrimaryAnnotatedThing != default)
if (this.PrimaryAnnotatedThing != null)
{
dictionary.Add("PrimaryAnnotatedThing", new [] { this.PrimaryAnnotatedThing.Value });
}
Expand Down Expand Up @@ -162,9 +162,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Author":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Author property is not allowed.");
errors.Add($"Removed reference '{id}' from Author property results in inconsistent ChangeProposal.");
result = false;
}
result = false;
break;

case "Category":
Expand All @@ -174,9 +174,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "ChangeRequest":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from ChangeRequest property is not allowed.");
errors.Add($"Removed reference '{id}' from ChangeRequest property results in inconsistent ChangeProposal.");
result = false;
}
result = false;
break;

case "Discussion":
Expand All @@ -194,9 +194,9 @@ public override bool TryRemoveReferences(IEnumerable<Guid> ids, out List<string>
case "Owner":
if (addModelErrors)
{
errors.Add($"Remove reference '{id}' from Owner property is not allowed.");
errors.Add($"Removed reference '{id}' from Owner property results in inconsistent ChangeProposal.");
result = false;
}
result = false;
break;

case "PrimaryAnnotatedThing":
Expand Down
Loading

0 comments on commit 0771926

Please sign in to comment.