예제 #1
0
 private XmlExporter(XDocument document, XmlNamespaceManager namespaceManager, EA.Project projectInterface, ModelEntityRepository repo)
 {
     Document         = document;
     NamespaceManager = namespaceManager;
     ProjectInterface = projectInterface;
     Repo             = repo;
 }
예제 #2
0
 public static Option <SolutionInstantiationGraph> Create(ModelEntityRepository repo, SolutionEntity solutionItem)
 {
     return(from classifier in solutionItem.GetClassifier(repo.GetElement)
            from problemSpaceEntity in classifier.TryCast <ProblemSpaceEntity>()
            let problemSpace = DependencyGraph.Create(repo, problemSpaceEntity, DependencyGraphFilter)
                               let solution = DependencyGraph.Create(repo, solutionItem, DependencyGraphFilter)
                                              select new SolutionInstantiationGraph(repo, Merge(problemSpace, solution)));
 }
예제 #3
0
 public ExportProblemSpaceCommand(ModelEntityRepository repo, TailorPackageExportForm form,
                                  XmlExporter.Factory exporterFactory, SelectExportPathDialog exportFileDialog)
 {
     Repo             = repo;
     FilterForm       = form;
     ExporterFactory  = exporterFactory;
     ExportFileDialog = exportFileDialog;
 }
예제 #4
0
        public DependencySelectorForm(ModelEntityRepository repo)
        {
            Repo = repo;

            InitializeComponent();

            dependencyTreeView.CheckBoxes  = true;
            dependencyTreeView.AfterCheck += dependencyTreeView_AfterCheck;
        }
예제 #5
0
        public ProblemSpaceTree InstantiateSolutionElements(ModelEntityRepository repo)
        {
            var instantiations = from instantiation in ElementInstantiations
                                 select PackageInstance.Fold(
                (solutionPackage) =>
                instantiation.CreateInstanceIfMissing(repo, solutionPackage),
                () => instantiation);

            var children = Children.Select(c => c.InstantiateSolutionElements(repo));

            return(new ProblemSpaceTree(Package, PackageInstance, instantiations, Diagrams, children));
        }
예제 #6
0
        private void CreateSolutionDiagrams(ModelEntityRepository repo, IEnumerable <ElementInstantiation> instantiations)
        {
            PackageInstance.Do(solutionPackage =>
            {
                Diagrams.ForEach(problemDiagram =>
                {
                    var solutionDiagram = repo.Create(problemDiagram.Name, DiagramTypes.SolutionOverview, solutionPackage, ADTechnology.Technologies.AD.ID);
                    CopyDiagramObjects(problemDiagram, solutionDiagram, instantiations);
                });
            });

            Children.ForEach(c => c.CreateSolutionDiagrams(repo, instantiations));
        }
예제 #7
0
        public void InstantiateSolutionConnectors(ModelEntityRepository repo)
        {
            var allInstantiations = AllInstantiations().Run();
            // connections between new instances
            var connections = from instantiation in allInstantiations
                              from source in instantiation.Instance
                              from connector in instantiation.Element.Connectors
                              where connector.EaObject.ClientID == instantiation.Element.Id
                              from connectorStype in connector.GetStereotype(ADTechnology.Technologies.AD.ConnectorStereotypes)
                              from targetInstantiation in allInstantiations
                              where connector.EaObject.SupplierID == targetInstantiation.Element.Id
                              from target in targetInstantiation.Instance
                              select Tuple.Create(source, connectorStype, target);

            // connections from new instances to referenced elements
            var referenceConnectionsFrom = from instantiation in allInstantiations
                                           from instance in instantiation.Instance
                                           from connector in instantiation.Element.Connectors
                                           where connector.EaObject.ClientID == instantiation.Element.Id
                                           from target in connector.Target(repo.GetElement)
                                           where !target.Is(ProblemSpace.Problem) && !target.Is(ProblemSpace.Option)
                                           select Tuple.Create(instance, connector.ReconstructStereotype(), target);

            // connections from referenced elements to new instances
            var referenceConnectionsTo = from instantiation in allInstantiations
                                         from instance in instantiation.Instance
                                         from connector in instantiation.Element.Connectors
                                         where connector.EaObject.SupplierID == instantiation.Element.Id
                                         from source in connector.Source(repo.GetElement)
                                         where !source.Is(ProblemSpace.Problem) && !source.Is(ProblemSpace.Option)
                                         select Tuple.Create(source, connector.ReconstructStereotype(), instance);

            connections
            .Concat(referenceConnectionsFrom)
            .Concat(referenceConnectionsTo)
            .ForEach((source, connectorStype, target) =>
            {
                try
                {
                    repo.Connect(source, target, connectorStype);
                }
                catch (Exception)
                {
                    // TODO: proper error handling
                }
            });
        }
예제 #8
0
        private static DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> Create(
            ModelEntityRepository repo,
            ModelEntity.Element source,
            DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> dependencyGraph,
            Func <ModelEntity.Element, ModelEntity.Connector, ModelEntity.Element, bool> edgeFilter)
        {
            var targets = from connector in source.Connectors
                          from target in connector.OppositeEnd(source, repo.GetElement)
                          where edgeFilter(source, connector, target)
                          select Tuple.Create(source, connector, target);

            return(targets.Aggregate(dependencyGraph, (graph, edge) =>
            {
                var connected = graph.Connect(edge.Item1, edge.Item2, edge.Item3);
                if (graph.NodeLabels.Any(nl => nl.Guid == edge.Item3.Guid))
                {
                    return connected;
                }
                else
                {
                    return Create(repo, edge.Item3, connected, edgeFilter);
                }
            }));
        }
예제 #9
0
 public Factory(ModelEntityRepository repo, IReadableAtom <EA.Repository> eaRepo)
 {
     Repo   = repo;
     EaRepo = eaRepo;
 }
 public PasteTaggedValuesIntoChildrenCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo)
 {
     Clipboard = clipboard;
     Repo      = repo;
     Form      = new SelectDescendantsForm();
 }
 public UpdateMetadataOfNewElementsCommand(ModelEntityRepository repo)
 {
     Repo = repo;
 }
 public UpdateProblemOccurrenceStateOnAlternativeRemoved(ModelEntityRepository repo)
 {
     Repo = repo;
 }
예제 #13
0
 private SolutionInstantiationGraph(ModelEntityRepository repo, DirectedLabeledGraph <ElementInstantiation, ModelEntity.Connector> graph)
 {
     Repo  = repo;
     Graph = graph;
 }
 public InstantiateProblemSpaceCommand(ModelEntityRepository repo, InstantiateSolutionForm solutionNameForm)
 {
     Repo             = repo;
     SolutionNameForm = solutionNameForm;
 }
 public PopulateDependenciesCommand(ModelEntityRepository repo, IDependencySelector selector)
 {
     Repo     = repo;
     Selector = selector;
 }
예제 #16
0
 public ElementInstantiation CreateInstanceIfMissing(ModelEntityRepository repo, ModelEntity.Package package)
 {
     return(Instance.Fold(
                _ => this,
                () => Copy(instance: repo.Instantiate(Element, package, ADTechnology.Technologies.AD.ElementStereotypes))));
 }
예제 #17
0
 public void CreateSolutionDiagrams(ModelEntityRepository repo)
 {
     CreateSolutionDiagrams(repo, AllInstantiations());
 }
예제 #18
0
 public AnalysePackageCommand(ModelEntityRepository repo, DisplayMetricsForm displayMetricsForm)
 {
     Repository         = repo;
     DisplayMetricsForm = displayMetricsForm;
 }
예제 #19
0
 public PasteTaggedValuesCommand(IReadableAtom <TaggedValuesClipboard> clipboard, ModelEntityRepository repo)
 {
     Clipboard = clipboard;
     Repo      = repo;
 }
예제 #20
0
        public ProblemSpaceTree InstantiateSolutionPackages(Option <ModelEntity.Package> parentPackage, ModelEntityRepository repo, Option <String> name)
        {
            var solutionPackageName = name.GetOrElse(Package.Name);
            var solutionPackage     = repo.CreatePackage(solutionPackageName, parentPackage, SolutionSpace.SolutionSpacePackage.AsOption());

            var children = Children.Select(c => c.InstantiateSolutionPackages(solutionPackage.AsOption(), repo, Options.None <String>()));

            return(new ProblemSpaceTree(Package, Options.Some(solutionPackage), ElementInstantiations, Diagrams, children));
        }
예제 #21
0
 public EaToAdRepoConverter(ModelEntityRepository repo)
 {
     this.repo = repo;
 }
예제 #22
0
 public static DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector> Create(ModelEntityRepository repo, ModelEntity.Element rootNode,
                                                                                        Func <ModelEntity.Element, ModelEntity.Connector, ModelEntity.Element, bool> edgeFilter)
 {
     return(Create(repo, rootNode,
                   new DirectedLabeledGraph <ModelEntity.Element, ModelEntity.Connector>(rootNode),
                   edgeFilter));
 }