Book a Demo

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 - michael.jeier

Pages: [1]
1
Actually, this is exactly what I want. I want a use case, which contains a diagram. This makes up my composite. Then I'm also adding the use case to the underlying diagram. So when I double-click the use case I arrive at the diagram of that use case.
I played around with the code a little more, but it seems that this is a bug in the API as it creates a composite, but it is not shown as composite and doesn't work like a composite (as I mentioned in my post before).
 :(

2
Thanks again! I tried to make a composite out of the use case and the diagram, but it didn't quite work.

You actually get a composite when you just do this:
Code: [Select]
elmUseCase.Subtype = 8;

BUT: it is only a composite in so far that when you right-click the use case in a diagram the "Composite" property is checked under "Advanced". It does not open the corresponding diagram when you double-click it and it also doesn't show the little "composite icon" in the use case bubble.

So I also tried to set the parent of the diagram, but this doesn't have any effect.
This is my code so far:
Code: [Select]
// create the use case
EA.Element elmUseCase = (EA.Element)package.Elements.AddNew(strUseCaseName, "Use Case");
 elmUseCase.Update();

// create the use case diagram
 EA.Diagram newDiagram = (EA.Diagram) elmUseCase.Diagrams.AddNew(strUseCaseName, "Use Case");
newDiagram.ShowDetails = 0;
newDiagram.Update();

// add the use case to the diagram
EA.DiagramObject obj = (EA.DiagramObject)newDiagram.DiagramObjects.AddNew("", "");
obj.ElementID = elmUseCase.ElementID;
obj.Update();

// TODO make a composite
elmUseCase.Subtype = 8;
newDiagram.ParentID = elmUseCase.ElementID;
newDiagram.Update();
//elmUseCase.ParentID = newDiagram.DiagramID;
elmUseCase.Update();

Does anyone has an idea what I'm doing wrong?  :-/

Regards, Michael

3
D'oh! Well of course it's a DiagramObject. Thanks a lot!! :) That does the trick.

Btw, can I make a composite out of this use case and diagram? I searched the API, but didn't find anything for this.

4
Thank you both for your helpful insights. Unfortunately, the suggest approach won't work, because the field "ElementID" is read only. :(

I tried this:
Code: [Select]
EA.Element obj = (EA.Element) newDiagram.DiagramObjects.AddNew("", "");
obj.ElementID = elmUseCase.ElementID;
obj.Update();

The field Element GUID is also read-only. I'm assuming there must be another way, but how??

Regards, Michael

5
Hi,

I'm trying to add an existing use case to a diagram, but unfortunately it seems that one can only add new elements to a diagram:

Code: [Select]
EADiagram.DiagramObjects.AddNew(string Name, string Type);

Is there any way?? Any help on this would be appreciated - thanks!

Regards, Michael

6
Hi there,

is it possible to automatically import searches into EA?

When I go to the "Manage Searches" dialog (Ctrl + F>Manage Searches) I can export and import searches as XML files. I want to make it possible for all users to import (or update) all current searches automatically or just with a mouse-click. Is there some function in the API I can use???
(I looked through the documentation of 7.1 and 7.5).

Regards, Michael

7
Hi,

yup - that worked! I knew I was missing something completely obvious!  :-/ Thanks a lot!!

Regards, Michael

8
Automation Interface, Add-Ins and Tools / Cannot add a File to a Use Case
« on: October 02, 2008, 03:58:44 am »
Hi,

I'm trying to add a File to a Use Case, but it isn't working though I get true, when I do an Update(). The File is simply not added to the properties when I check it manually on the Use Case. I also check before, whether it's the right Use Case - it is.  :-?

Here's the code snippet:

Code: [Select]
          // element is an EA.Element
            MessageBox.Show("Use Case name: " + element.Name
                    + " element ID: " + element.ElementID);
            element.Files.AddNew(strURL, "Web Address");
            bool updated = element.Update();
            element.Files.Refresh();
            element.Refresh();
            MessageBox.Show("updated: " + updated.ToString()); // true

Does someone see a mistake there??!? I really don't know what else to do.  :(  Thanks!

Regards, Michael

9
Hi,

thanks again! I made a "home diagram" for every use case so that the use cases can be linked.  8-)

And I added a custom program to the tools with a shortcut. But I don't want to add another tool for every functionality I program. Is there a way to add those functions to the popup menu of elements???

Btw, which API is the more powerful and has the best performance? Java or C#? I tried both and noticed that the API does not use an existing instance of EA, but opens its own. This makes it kinda slow. Can one use the already open instance of EA (if there's one)????

Regards, Michael

10
Hi,

ah, got it - thanks!  :)

When I open the shortcut file with an editor it looks like this:

Code: [Select]
EAConnectString:C:\Test.eap
OpenActions:$diagram://{DE1DF219-A90A-4056-AE48-D1FDA8E6F816}

Hmm, there's the path to the original file and an unique identifier to the diagram which should be opened. Well, a couple of questions are just popping into my head:

1. Can one do the same with a database repository instead of a file? (I tried to create a database repository to test this but I didn't get it to work, yet.)
2. Is it possible to get this unique identifier from the API?
3. Are diagrams the only thing which can be opened this way?
4. Is it generally possible to add a (toolbar?)-button to EA, which could generate such a shortcut file or something similar??

Thanks in advance for any help on these questions!

Regards, Michael

11
Well this might be allright:

Quote
You can save a pointer to an EA project as if it were an EAP file (so it shows up as a desktop icon say). When you double-click the icon EA will open the appropriate project. When you do this you can set up a default diagram and such.

Hmmm, I searched the documentation, but I cannot find anything. How do I create those pointers???

12
Hi,

I want to automatically open EA from another tool, i.e. I want to have something like an URL or link which the user can click and then opens EA on a certain diagram. Is this even possible??? I tested the Java API a bit, but I could not make the EA instance visible which was created.

Someone please help!

Regards, Michael

Pages: [1]