public Unit Execute(ModelEntity.Package problemSpace) { SolutionNameForm.GetSolutionName().Do(solutionName => { Repo.SaveAllDiagrams(); var parentPackage = problemSpace.GetParent(Repo.GetPackage); var problemSpaceTree = ProblemSpaceTree.Create(problemSpace); var instantiatedTree = problemSpaceTree .InstantiateSolutionPackages(parentPackage, Repo, Options.Some(solutionName)) .InstantiateSolutionElements(Repo); instantiatedTree.InstantiateSolutionConnectors(Repo); instantiatedTree.CreateSolutionDiagrams(Repo); }); return(Unit.Instance); }
public EntityModified Execute(SolutionEntity solutionEntity) { Repo.SaveAllDiagrams(); var modified = from currentDiagram in GetCurrentDiagramContaining(solutionEntity) from solution in SolutionInstantiationGraph.Create(Repo, solutionEntity) let solutionTree = solution.Graph.ToTree(DirectedLabeledGraph.TraverseEdgeOnlyOnce <ModelEntity.Connector>()) let preMarkedSolutionTree = SelectRootWithAlternatives(solutionTree) from markedSolutionTree in Selector.GetSelectedDependencies(preMarkedSolutionTree) let markedSolution = solution.WithSelection(markedSolutionTree.NodeLabels) let targetPackage = Repo.FindPackageContaining(solutionEntity) let instantiatedSolution = markedSolution.InstantiateSelectedItems(targetPackage) let _1 = instantiatedSolution.InstantiateMissingSolutionConnectors() let _2 = instantiatedSolution.CreateDiagramElements(currentDiagram) select EntityModified.Modified; return(modified.GetOrElse(EntityModified.NotModified)); }