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 - ankur

Pages: [1] 2
1
Hello,

I am trying to extract all the elements connected to the other end of the DiagramGate in Sequence Diagram using EA API in C#.

Till now, I am calling out all connectors from a diagram and extracting the "Supplier" from the Connector where the "Client" type is MessageEndpoint. Something like this:

Code: [Select]
foreach (Connector singleConnector in singleDiagram.Connectors )
{
    if (Repository.GetElementByID(singleConnector.ClientID).Type.Equals("MessageEndpoint"))
    {
        Element theElement = Repository.GetElementByID(singleConnector.SupplierID);
    }
}

But I want to read all the elements connected to the given DiagramGate (independent of diagrams) using EA API.

I can see the Relationships when I right click the DigramGate and then go to Properties -> Special Actions -> Related -> Links.

Is there a possibility to extract the "Relationships" using EA API ?

Thanks in advance.

Regards,
Ankur

2
Hi Ankur,

Try Repository.ConnectionString

It worked. Thanks Guillaume :)

3
Hello,

I would like to get the complete directory path in EA Add-in along with the filename for the current .eapx file that I have opened.

I have tried the following in C# code for the Add-in:

Console.WriteLine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
Console.WriteLine(System.AppDomain.CurrentDomain.BaseDirectory);
Console.WriteLine(System.Environment.CurrentDirectory);
Console.WriteLine(System.IO.Directory.GetCurrentDirectory());
Console.WriteLine(Environment.CurrentDirectory);

But all of them return me the path of EA.exe and not my abc.eapx file.

Can anyone guide me in this regard.

Thanks in advance.

Regards,
Ankur

4
That worked.

Thanks Geert  :)

5
Hello,

I am writing an Add-in in EA 14. I would like to get the name of the package I selected in the Repository using a single click, i.e. highlighted package.

Is there a possibility to read out that name in EA Object model ?

Regards,
Ankur

6
Hello q,

You are right. Maybe a standalone application would be what we might implement in future.

Thanks for your support :)

Regards,
Ankur

7
Hello qwerty,

It's just a simple C# code to read the UML content in EA Repository and dump it into a specific file with some pre-formating.

As of now, we are not using any Add-in.

Regards,
Ankur

8
Hi q,

It worked, but I had to tweak some stuff. Mabe it might be useful for others.

Past: I was opening EA Repository (.eapx file) and then read from Repository. I used EA API in Visual Studio (C# code) to read the process ID of EA.exe application. Finally, I read the Repository contents.

Now: I am using Repository.OpenFile (need to mentionexplicit .eapx file location) in my C# code in Visual Studio and at the end of execution, implementing Repository.Exit();

Thanks for the response :)

Regards,
Ankur

9
Hello,

I have a Windows 7 environment and am running EA 14 on it.

Although I have opened only 1 instance of EA (my current working respository), I see in Task Manager that multiple EA.exe processes are running automatically. Sometimes it's 1 extra EA.exe process but sometimes they are more than 5 (apart from the main EA.exe process).

I tried using TASKKILL command in a batch script to kill the rogue EA.exe processes. But I think as I don't have Administrator rights, it does not work.

It is annoying as everytime I have to run a C# code to read the Repository using EA API, I have to manually "end" the rogue EA.exe processes and execute my code quickly before the rogue EA.exe processes start again.

Please find the screenshot of recent Task Manager activity here (The rogue EA.exe processes are usually approx 27000K in size):

https://pasteboard.co/I8HAaCV.png

The same problem is occuring on a colleague's computer as well.

Has someone else encountered the same issue ? Could you please assist me with a solution or a workaround ?

Thanks in advance.

Regards,
Ankur


10
Hello Peter,

Thanks for your quick response. Yes, I will now try to generate the path using recursion.

Regards,
Ankur

11
Hello,

I am trying to generate a file based on the elements available withing a particular Package. I would like save the generated file in the same windows directory structure as the nested Package structure.

For eg:
Nested Package structure is: Project --> Package A --> Package B --> Package C

The corresponding file should be saved in a path which looks like: C:/*/Project/PackageA/PackageB/PackageC/<Filename>

Is there a possibility in EA API to get the package hierarchy from a given nested Package ?

Thanks in advance.

Regards,
Ankur

12
Hi Geert,

That worked. Thanks a lot :)

Regards,
Ankur

13
If you are not already, you should package your profiles into an MDG technology.
Then make sure you set the toolbox to use on the diagram stereotypes.

If you want to completely block the other toolboxes you can
A) disable all MDG technologies you don't use
B) Use perspectives's to use only your MDG.

Geert

Hi Geert,

Thanks a lot for your quick response :)

As mentioned by you, I packed everything in MDG technology and imported it in my project. Then I disabled all other MDG technologies that are not needed.
Plus, I used perspective to use my MDG.

But I still have to choose 1 out of 2 toolboxes.

I am looking for something like this:

Diagram A --> Toolbox A

And when I create a custom Diagram B --> Toolbox B must be available automatically without switching over to Toolbox B from Toolbox A (as Toolbox A was selected when Diagram A was created).

Is it possible to change the Toolboxes dynamically based on the Diagram type ?

Thanks in advance.

With Regards,
Ankur

14
Hello,

I have created 2 custom diagrams with a profile along with 2 custom toolboxes corresponding to each Diagram type and imported them in the project. All looks good and I can drag n drop the elements from Toolbox page to the diagram along with custom stereotypes.

1. I simply would like to hide all other toolbox pages apart from the one that I have created (in toolbox). For eg.  extended a UML Class diagram to create my own customized diagram. But, when I also add the toolbox profile, apart from my toolbox page, all other toolbox pages are available there. I don't wanted those.

2. I would also like to get the toolbox to update automatically based on the custom diagram type selected.

Can somebody guide me in the right direction ?

Thanks in advance.

Regard

15
Hello again,

After thinking about the previous discussed potential solution... it will be too complicated to work with an intermediate file, and it will not really cover our use case.

I need to explain a little bit more our application   ;)
We are writing a command-line program (.exe), which will be directly started from external programs, among other makefiles, without the need to open EA because :

 1. EA takes too much time to start and
 2. we can not install EA on any potential PC used in our company.
 
 Moreover, our command-line program becomes several project-specific parameters which are dynamically prepared from the other programs, e.g. like a makefile does, depending of the project context, and its role is to extract specific data from the EAP-file - these dynamic generated parameters can not be known at modelling level in EA.

The command-line program just needs to read data - no model modification. It is intended to be used by System-integrators, System-testers and managers, which don't need (and don't know how) to use EA - this must remain transparent for such kind of people.

Only for the SW-Designers (who build the models), the command-line program will be integrated directly in EA via a menu / ribbon - so that they can check their modelling work output before releasing it.

Is there a way to use the EA-API without opening EA?
(I mean: not by using directly the ACCESS-DB queries)"

Regards,
Ankur

Pages: [1] 2