Skip to content

Commit

Permalink
Fixes #693 plug the function into model construction
Browse files Browse the repository at this point in the history
  • Loading branch information
msevestre committed Feb 15, 2023
1 parent ebf90b4 commit 1608e63
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 52 deletions.
4 changes: 2 additions & 2 deletions src/OSPSuite.Core/Domain/ObjectPathKeywords.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OSPSuite.Core.Domain
public static class ObjectPathKeywords
{
//list of all keywords defined
private static readonly IList<string> _allKeywords = new List<string>();
private static readonly List<string> _allKeywords = new List<string>();

/// <summary>
/// String representing a reference to local Molecule
Expand Down Expand Up @@ -73,6 +73,6 @@ private static string addKeyword(string keyword)
return keyword;
}

public static IEnumerable<string> All => _allKeywords;
public static IReadOnlyList<string> All => _allKeywords;
}
}
3 changes: 3 additions & 0 deletions src/OSPSuite.Core/Domain/Services/ModelConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public CreationResult CreateModelFrom(IBuildConfiguration buildConfiguration, st
//replace all keywords define in the model structure once all build processes have been executed
_keywordReplacerTask.ReplaceIn(model.Root);

//This needs to be done before we validate the model to ensure that all references can be found
_formulaTask.ExpandNeighborhoodReferencesIn(model);

creationResult.Add(validateModel(model, buildConfiguration));

if (creationResult.State == ValidationState.Invalid)
Expand Down
Loading

0 comments on commit 1608e63

Please sign in to comment.