Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - McMannus

Pages: [1] 2 3 ... 7
1
General Board / Re: EA Repository Table; How to get diagram types?
« on: January 26, 2018, 12:07:42 am »
Definitely gonna try that one as the feature table outperforms MDB Viewer plus the support for multiple DB types is great :-)
Thanks Geert!

2
General Board / Re: EA Repository Table; How to get diagram types?
« on: January 25, 2018, 11:35:02 pm »
Hi,

The diagram metatype is stored in the StyleEx column of t_diagram. It is a MEMO field and contains a semi-colon separated list of key-value pairs, of which the key "MDGDgm" contains the type you are searching for as shown in the example below. As you can see getting this solely by query is not the easiest task, but with a script/add-in it is easily possible to parse the content of the attribute.
StyleEx content for a BDD:

SaveTag=721D3575;ExcludeRTF=0;DocAll=0;HideQuals=0;AttPkg=1;ShowTests=0;ShowMaint=0;SuppressFOC=1;MatrixActive=0;SwimlanesActive=1;KanbanActive=0;MatrixLineWidth=1;MatrixLineClr=0;MatrixLocked=0;TConnectorNotation=UML 2.1;TExplicitNavigability=0;AdvancedElementProps=1;AdvancedFeatureProps=1;AdvancedConnectorProps=1;m_bElementClassifier=1;ProfileData=;MDGDgm=SysML1.3::BlockDefinition;STBLDgm=;ShowNotes=0;VisibleAttributeDetail=0;ShowOpRetType=1;SuppressBrackets=0;SuppConnectorLabels=0;PrintPageHeadFoot=0;ShowAsList=0;SuppressedCompartments=;Theme=:119;

PS: For examining EA databases and finding information, I found a small tool, where you can browse through an actual EA project with data easily and perform SQL queries (also update and insert queries unlike through EA's SQL editor): http://www.alexnolan.net/software/mdb_viewer_plus.htm

3
Hi guys,

in model-based engineering, a core means for complexity reduction is to use multiple views (EA diagrams) for the same component (EA element) for depicting certain development aspects. For instance in the embedded system domain, there are architectural perspectives containing data flow views or dependency views. For the same component, there also exist quality perspectives such as the failure propagation through the component, which is related to the quality safety.

A typical model structure for this setting is illustrated in the image at the following link: Example

The example contains the architectural component "MyComponent" having 3 views, where the first one contains full details and the other two contain only certain aspects (in this case a subset of the interface). The "FailureModel MyComponent" is a separate element having 3 views, too.

To indicate that the failure propagation model is targeting "MyComponent", EA connectors can be used to formally relate both elements with each other. However, the aspects, which are solely existent through the notion of diagrams, don't offer the possibility for formal relation, although this would be very beneficial for automated consistency validation, i.e. if I add a port to e.g. aspect 1, I only want it to be shown in aspect 1 of the failure view as well, but not in aspect 2.

Is there a way in EA to formally relate or link two diagrams with each other, so that uambiguous programmatical navigation from a diagram of one element to a diagram of another element gets possible? (blue double arrows in the image)

As I'm quite fit in writing add-ins for EA, I know there is always the possibility to keep a custom programmatical map between the diagrams somewhere in the add-in. However, this would not be my first choice, as it means manual maintenance of consistency, when the user deletes or changes diagrams. I'm rather thriving to a native EA solution to the problem and hope I just overlooked a feature in the past 10 years of using EA :-)

Many thanks for your help.

Jan

4
Are you able to open the same file from an non-Japanese version of Access?
Yeah, I used already MDB Viewer Plus to look into the database to find something suspicious, but with no success. My english EA, however, does not allow me to open the file. It's funny that an XMI Export of the same project (exported from Japanese version) followed by an XMI Import in my English version works.

5
Yes, actually I already found a problem, which is directly related to EA itself. When trying to open an EAP file that has been created with the Japanese version (I'm using the English version), EA signals "An Error has occurred: Unrecognized database format" and refuses opening the project.

Any ideas from Sparx side what the cause of this problem could be and how to solve this issue?

Jan

6
Hi all,

I'm currently having a customer from Japan using the Japanese edition of EA. I wonder, if the different language and in particular the different characters might brake something in our add-ins. I mainly think about plain SQL query interpretation going through Rep.SQLQuery() and Rep.Execute().

Did someone of you guys experience problems with that?

Many thanks!
Jan

7
General Board / Re: Recursive SQL statements using WITH (CTE)
« on: August 01, 2017, 09:09:15 pm »
What you can also try is directly working on the EAP project with C# DB access mechanisms. I did that once for updating absolute paths for toolbox profile icons to the current version control checkout path (helps enormously if different work on MDG development). I believe with this method, the syntax you are allowed to use is just the database technology itself, so you could try the with statement with this method:

Code: [Select]
                var profilesProject =  "profiles.eap";
                const string iconFolder = "\\icons";
                try
                {

                    OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;"
                                                               + "Data Source=" + profilesProject);
                    conn.Open();

                    using (DataTable dt = new DataTable())
                    {
                        using (OleDbDataAdapter adapter = new OleDbDataAdapter(@"SELECT [Default],ID FROM t_attribute WHERE Name='Icon'", conn))
                        {
                            adapter.Fill(dt);
                        }
                        List<string> queries = new List<string>();
                        foreach (DataRow row in dt.Rows)
                        {
                            string toolboxIconPath = row["Default"].ToString();
                            if (!toolboxIconPath.StartsWith(executingFolder))
                            {
                                int index = toolboxIconPath.IndexOf(iconFolder);
                                if (index > 0)
                                {
                                    string newPath = executingFolder + toolboxIconPath.Substring(index);
                                    Console.WriteLine("\tReplacement: " + toolboxIconPath + " -> " + newPath);
                                    queries.Add("UPDATE [t_attribute] SET [Default]='"+newPath+"' WHERE [ID]="+row["ID"]);
                                }
                            }
                        }

                        if (queries.Any())
                        {
                            Console.WriteLine("\nAre the replaced paths correct? Go on with 'y'");
                            ConsoleKeyInfo pressedChar = Console.ReadKey();
                            if (pressedChar.KeyChar == 'y')
                            {
                                foreach (string query in queries)
                                {
                                    using (OleDbCommand cmd = new OleDbCommand(query, conn))
                                    {
                                        cmd.ExecuteNonQuery();
                                    }
                                }
                                Console.WriteLine("\nToolbox Icon Paths updated successfully :-)");
                            }
                        }
                    }

                }
                catch (Exception e)
                {
                    Console.WriteLine("\nAn error occured during updating the toolbox icon image paths. Are you sure that you have the SVN lock on the profiles.eap file?");
                }
                Console.WriteLine("\n\nPress any key to exit...");
                Console.ReadKey();

8
Be aware that not every connector has a diagram link row by default. This is yet another inconsistency to diagram objects. Before changing the diagram link via SQL make sure that the diagram link for your connector and specific diagram really exists. If this is not the case, you can create the link via code.

We do this for similar use cases (in this case bend point application to connectors) like shown below. The importance piece is the logic plus the insert query, which took me quite some time to get it accepted by EA.

Code: [Select]
        public void changeConnectorLayout(IDualConnector conn, int diagramID, IEnumerable<Point> bendPoints = null)
        {
            string diagramLinkAvailableQuery = "SELECT ConnectorID FROM t_diagramlinks WHERE ConnectorID=" + conn.ConnectorID + " AND DiagramID=" + diagramID;
            string linkAvailable = EAFacade.RetrievalCore.getFieldByQuery(diagramLinkAvailableQuery, "ConnectorID");
            if (linkAvailable == null)
            {
                string insertDiagramLinkSQL = "INSERT INTO t_diagramlinks(DiagramID, ConnectorID, Geometry, Style, Hidden) " +
                    "VALUES(" + diagramID + "," + conn.ConnectorID + @",'EDGE=1;$LLB=;LLT=;LMT=;LMB=;LRT=;LRB=;IRHS=;ILHS=;','Mode=3;Color=-1;LWidth=0;Tree=OR;',False)";
                EAFacade.rep.Execute(insertDiagramLinkSQL);
                changeConnectorLayout(conn, diagramID, bendPoints);
            }
            else
            {
                ConnectorLayout layout = new ConnectorLayout(conn.ConnectorID, diagramID);
                layout.Create();

                string newStyleSQL = layout.GetStyleDBString();
                string newGeometrySQL = layout.GetGeometryDBString();
                string newBendPoints = layout.SetBendPoints(bendPoints.ToList());

                string setBendPointsSQL = "UPDATE t_diagramlinks SET Style='" + newStyleSQL + "', Geometry='" + newGeometrySQL + "', Path='" + newBendPoints + "' WHERE DiagramID=" + diagramID + " AND ConnectorID=" + conn.ConnectorID;
                EAFacade.rep.Execute(setBendPointsSQL);
            }
        }

9
Hi guys,

I'm modeling and analyzing component architectures with a custom profile + add-in. The syntax and semantics are pretty close to SysML and therefore I'd like to have an arbitrary number of diagrams (like Internal Block Diagrams) per component. As far as I understand, EA's SysML extension derives the association of a diagram to a block only through the implicit containment in the project browser, i.e. when I move the diagram somewhere different in the model, the "formal" relation gets lost.

This is exactly the problem I'm trying to solve. The possibilities I thought about are:
1. Introduce a reference list tagged value to the component that is manually maintained in the add-in.
2. If a list of associated diagrams should be retrieved, search through the diagram elements of existing diagrams and take the ones, where the component is used largest element containing its realization.

In the past, we used Option 1 in similar use cases, but it proved to be a pain in the ass to maintain tagged value lists of GUIDs manually during deletion and creation. In addition, reuse model parts in different projects is pretty hard, because the GUIDs get outdated quickly in that case.
Option 2 is again implicit and not very robust.

Does anyone of you have a better idea, how this could be solved? The ideal solution would be a connector between an element and a diagram, but that is not possible as far as i know.

Thanks for any insight!
Jan

10
Hi guys,

I have defined several relation stereotypes in our profiles that serve for traceability and containment. The containment relations aim at specifying a containment structure being independent from the implicit containment existent through the project browser. The driver for this decision was EA's automatic model movement of elements to other parents based on diagram movement.

When elements are created from the toolbox or programmatically, the relations are automatically created. As we know, a connector is shown by default, if both source and target element appear together in a diagram. This clutters diagrams a lot for my specific use case, therefore I'd like to hide these connectors by default. My approach for doing so was to hide the diagram links in code directly after I put the elements and the connector in the diagram programmatically.

The problem is that the hiding doesn't have any effect, because the diagram link is apparently not created immediately, when the elements (connected already in the model) are put in the diagram.

I wonder if it's possible to hide certain stereotyped connectors through the profile definition directly.

I didn't find anything in the docs w.r.t such a feature. If this is not possible, I have to solve that programmatically somehow.

In this case: Did someone face a similar issue in the past that diagram links only appear delayed in t_diagramlinks and probably has a solution for this issue?

Another option, we used for similar things in the past was to use refGUID tagged values referencing the related elements. However, I remember, they had to be maintained manually (i.e. potential inconsistencies because of deletions of referenced elements) and therefore we discarded this approach back then.

Thanks for your help, guys :-)

Jan

11
If you click on the Sparx menu on the left upper corner of the tool, you will see a search bar at the bottom of the menu. There you can enter old menu entries and invoke them! Alternatively, you can change the Visual Style under Start > Workspace > Visual Style to Microsoft Office 2016. After that a search bar is shown directly next to the main menus (on the right).

12
General Board / Re: Auto layout Diagram from Visual Basic
« on: August 26, 2016, 11:32:26 pm »
Long story short:

Paolo is right: You cannot programmatically access the layout types like Circle, Box, etc. you know from the UI.

The only means of performing some programmatic layout with EA is through
Code: [Select]
Project.layoutDiagramEx(string DiagramGUID, long LayoutStyle, long Iterations, long LayerSpacing, long ColumnSpacing, boolean SaveToDiagram)
where LayoutStyle is one of the Enum values qwerty posted.

13
General Board / Re: Auto layout Diagram from Visual Basic
« on: August 23, 2016, 09:06:08 pm »
Hi Knightrider,

have a look at the Project Interface class and its layoutDiagramEx() method.

http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/automation_and_scripting/project_2.html

Best Regards,
Jan

14
Bugs and Issues / Re: Model Root Package API inconsistency
« on: August 21, 2016, 03:14:31 am »
Hi Helmut,

I know about the different package types EA has, but in any case, the two methods should return the same object type for the same thing.

15
Bugs and Issues / Re: Model Root Package API inconsistency
« on: August 19, 2016, 12:22:45 am »
-> Uploaded pictures to server!

Pages: [1] 2 3 ... 7