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

Pages: [1] 2
1
Lol  ;D

Before i can make those improvements they will kill me for my incompetence.  ;)

2
Ok.

I made a big mistake.  :-[
Everytime i made an element or diagram update i updated their parent package too. I removed those updates and it showed that these updates are not neccessary.

I decreased the computation time from 7 minutes to 40 seconds!

Sorry  :-[

3
Thx Mister Bellekens,

i kicked the refresh operations and got some improvement.
1000 elements take 7 minutes now.

BatchAppend and EnableUIUpdate did just some minor improvements (seconds). EnableCache seems to even increase the computation time.

But i have to do some more research.

thx.


4
Hello community,

currently i am making an import add-in for EA.
The objects are stored in an xml file.

For each object i generate an EA.Element and make some updates and refreshes.
Code: [Select]
EA.Element subElement = constructElement(element, subReq);
subElement.Update();
subElement.Refresh();

I generate some tagged values too and call update.
Then i update the package containing the element.
Furthermore i make a diagram and a diagramobject for each element. Some updates and refreshes following.

It takes decades to import 1000 objects.

Are there any recommendations for using refresh and update. Can i save some time not calling them? Or are there other bottlenecks?

5
Hello community,

im using the reporting functionality of EA for my own reporting tool.

If i run my program and it invokes RunReport(...) my current window looses focus. I invoke RunReport not just once and it is really annoying if you wan to write some document while generating an report.

Is there any solutuion for this?

thx

6
Hello Community,

ive made an reporting-addin for ea with c#. Its in use on many machines of a big company.

Now i made some bugfixes and wanted to test it on the machine of an user. But how can i update the addin.
An replacement of the dll does not work. What else do i have to take into account? Reboot of the machine, change of registry keys, Newly register the dll?

I appreciate any hints. Thx

7
Got the solution:

Updating the diagramID of my new diagramobjects:

Code: [Select]
EA.DiagramObject diagramObject = (EA.DiagramObject)diagram.DiagramObjects.AddNew(position, "Class");

diagramObject.ElementID = packageElement.ElementID;
diagramObject.DiagramID = diagram.DiagramID;

I think Sparx' employees should update their code samples. Sample "Add and Manage Diagrams" doesnt say anything about setting the DiagramID.

Thx for your help.

8
Hello community,

i am adding an diagram and some elements to my project with EA API.

My elements and diagram show up in the repository tree but my diagram does not contain any of my elements.

See below for my code:

Code: [Select]
private void processRequirements()
        {
            EA.Diagram diagram = (EA.Diagram)selectedPackage.Diagrams.AddNew("Anforderungsdiagramm", "Logical");
            selectedPackage.Update();

            foreach (Requirement r in requirementList)
            {

                EA.Element packageElement = (EA.Element)selectedPackage.Elements.AddNew(r.ID, "Class");

                packageElement.Notes = r.description;

                packageElement.Update();
                packageElement.Refresh();

                selectedPackage.Update();

                string position = ("l=200;r=400;t=200;b=600;");

                EA.DiagramObject diagramObject = (EA.DiagramObject)diagram.DiagramObjects.AddNew(position, "Class");

                diagramObject.ElementID = packageElement.ElementID;
                diagramObject.Update();
                selectedPackage.Update();
                selectedPackage.Elements.Refresh();
                diagram.Update();
                diagram.DiagramObjects.Refresh();
            }

I appreciate any hints. thx  :-/

9
Quote
Does the top level package GUID in the XMI match the GUID of the root node?

It will only replace the package if that is the case, otherwise it will behave as you have described.

No the top level package GUID in the xmi (OriginalModel) doesnt match the GUID of the root node (DestinationModel). I tried to manipulate it with:

Code: [Select]
DestinationModel.PackageGUID = System.Guid.NewGuid().ToString();
I hoped that the imported stuff always besomes a child-element of the existing model. So that i can rely on deterministic behaviour.

But now it doesnt import anything.The DestinationModel stays emtpy.

Yes i also tried to give both models the same guid. No desired effect.
Here is the whole XML-Import-Code:

Code: [Select]
public static void StartNewEAInstance(EA.Repository Repository)
        {
            Logging.Initialize(WorkingDirectory + @"Log.txt");

            Repository.GetProjectInterface().ExportPackageXMI(Model.PackageGUID, EA.EnumXMIType.xmiEADefault, 1, 1, 1, 1, WorkingDirectory + @"ProjectXML.xmi");


            EA.App App = new EA.App();

            App.Repository.OpenFile(AddInDirectory + @"dummy.eap");
            App.Visible = true;

            //TODO: Import von XMI.
            EA.Package OriginalModel = (EA.Package)Repository.Models.GetAt(0);
            EA.Package DestinationModel = (EA.Package)App.Repository.Models.GetAt(0);

            DestinationModel.PackageGUID = System.Guid.NewGuid().ToString();
            DestinationModel.Update();
            App.Repository.RefreshModelView(0);

            string ModelGUID = DestinationModel.PackageGUID;
            string OriginalGUID = OriginalModel.PackageGUID;

            App.Repository.Models.Refresh();

            App.Repository.GetProjectInterface().ImportPackageXMI(ModelGUID, WorkingDirectory + @"ProjectXML.xmi", 1, 0);

            App.Repository.Models.Refresh();
            App.Repository.RefreshModelView(0);

            TransformDiagramsToPackagesWithTree(App.Repository);

            
            ReportingKernel.Notify();
            //App.Repository.Exit();

            Logging.Close();
        }

Any solutions out there ?
Maybe i have to manipulate the GUID of the corresponding "Element" of the Package ?

EA Api is such a pain in the ass ... sorry for that.

10
Its me again.
I use following function to import an XMI to EA:

Code: [Select]
App.Repository.GetProjectInterface().ImportPackageXMI(ModelGUID, WorkingDirectory + @"ProjectXML.xmi", 1, 0);
Why doesnt it replace the existing root-model (The one corresponding to "ModelGUID")?
He just adds the imported branch as a child to the model. but i expected that the model-object will be replaced by the imported stuff.

Thx in advance

11
Sorry, i caused the problems with the diagram-order.

I use a for-loop where i move diagrams from a container into another container, do some computation and move them back.

Its a bad idea to change the contents of a container while you loop through it.  :-[

Used nearly a day for finding the bug. Or I better dont call it a bug. Its more inferior programming-expertise.

thankyou anyway....

12
The Export works fine, except some Details i mentioned in another post.
The second EA-Instance shows every Content of the imported Model correctly. Every package, diagram and element is contained.

But ive got a problem if i access (EA Api) the diagrams of the second repository, which holds the imported stuff.

I loop through all packages and their diagrams. I acces diagrams in the following way, like i always did:

Code: [Select]
EA.Package p = RootPackage;
                Logging.Write("Package: " + p.Name);

                     foreach(EA.Diagram d in p.Diagrams)
                    {
                        //TODO: Für den Fall, dass ein Paket nur ein Diagramm enthalten sollte, solltest du für das Paket-Chapter-Element das Diagramm mit einfügen. Bedenke die Besonderheiten bei der Kapitel-Stufe.

                        Logging.Write("     Diagram: " + d.Name);
                    }

The Diagram-Collections are containing the correct number of diagrams. But only every second diagram of the actiual diagrams. Remember that the diagrams are displayed correctly in EA.

Here is an example:
I have diagrams:
  • Classdiagram_1
  • Classdiagram_2
  • Classdiagram_3
  • Classdiagram_4
But the Collection "Package.Diagrams" contains:
  • Classdiagram_1
  • Classdiagram_3
  • Classdiagram_1
  • Classdiagram_3
What is the problem here ?

13
Automation Interface, Add-Ins and Tools / Re: Server is busy in EA
« on: January 29, 2009, 10:12:37 pm »
Quote
Does that mean your C# class (the public one which EA creates as COM object) implements IMessageFilter?

No, i created a class MessageFilter which implements IMessageFilter.
Then i integrated it in the EA_MenuClick-function in the main class (the one you are speaking of) like this:

Code: [Select]
public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName)
        {
            switch (ItemName)
            {
                case "&Dokument erstellen":

                    using (MessageFilter messageFilter = new MessageFilter())
                    {
                        // original contents are unchanged

                        ReportForm rf = new ReportForm();
                        rf.Show();
                    }
                    break;
              }
}

Greetings

14
Automation Interface, Add-Ins and Tools / Re: Server is busy in EA
« on: January 23, 2009, 09:21:06 pm »
Yes it seems to work.. I didnt get any "server is busy"-dialogs since i integrated the IMessageFilter-Interface.

You seem to speak german:
I wrote some details in this forum:
http://www.c-plusplus.de/forum/viewtopic-var-t-is-232291.html

But i actually did copy and paste from the page i mentioned in my post above.


Pages: [1] 2