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 - Geert Bellekens

Pages: 1 ... 478 479 [480] 481 482 ... 572
Ok, I think I understand.
If you want to create a new class diagram you'll need to add one to the element or package you want to create it under.
You'll need something like Package.Diagrams.AddNew()
Then you need to add elements to your diagram using the DiagramObjects collection, so Diagram.DiagramObjects.AddNew().

Make sure you link the diagramObject to the element in your model you want to show.

Then you can indeed play with the Style field to change color etc..



Its still not clear to me what you are trying to achieve.

Please explain in more detail.


Automation Interface, Add-Ins and Tools / Re: DiagramObject change
« on: June 14, 2013, 03:26:49 pm »
I'm afraid that won't do you any good since you can only know about a move of a diagramObject once the diagram has been saved.

And since there is no OnPostSaveDiagram...


Automation Interface, Add-Ins and Tools / Re: Wow!
« on: June 13, 2013, 03:35:24 pm »
I'm happy already with the error code. At least Google usually knows what might be the cause, and how to fix it.

It's still way better then before.


So what you are saying is that OnPostNewDiagramObject the diagramObject that you retrieve from the database has a different position then the diagramObject that is stored in the memory of EA's GUI.

The problem with diagramObjects is that their actual positions are not written to the database until you explicitly ask EA to save the diagram.

So ideally you should be able to access the DiagramObject that is used by EA's GUI to be able to get the actual correct values.

Now the problem is that you con't have access to that object. The only thing EA give you to work with is the ObjectID of the Object the DiagramObject is referencing.

So I think the only thing you can do is make sure the cached memory object of the DiagramObject is the same as the one that you retrieve from the database.
To do you you need to save the current diagram with Repository.SaveDiagram (long DiagramID) before you loop the diagram to get its diagramObjects.

So my code would look something like this:

Code: [Select]
public bool EA_OnPostNewDiagramObject(EA.Repository repository, EA.EventProperties eventProperties)
           EA.EventProperty property = eventProperties.Get(0);
           EA.Diagram diagram = repository.GetCurrentDiagram();
               Repository.SaveDiagram (diagram.DiagramID);
           foreach (EA.DiagramObject dObject in diagram.DiagramObjects)
                     if (dObject.ElementID == (int)property.Value)
                dObject.Style = "bCol=255";
           return true;


Try setting the supplierID instead of the ClientID.


I've recently added support for linked features in the EA Navigator (version 2.4, not yet released).
Heres the code inConnectorWrappers.cs that deals with that:

Code: [Select]
/// returns the related elements.
    /// In EA the Connectoris a binary relationship. So only two Elements will
    /// ever be returned.
    /// If there is a linked feature then the linked feature will be returned instead of the EA.Element.
    public List<UML.Classes.Kernel.Element> relatedElements {
        List<UML.Classes.Kernel.Element> returnedElements =  new List<UML.Classes.Kernel.Element>();
        //add client element
        //check first if there is a linked feature
        UML.Classes.Kernel.Element linkedClientFeature = this.getLinkedFeature(true) as UML.Classes.Kernel.Element;
        if (linkedClientFeature != null)
        //add supplier element
        //check first if there is a linked feature
        UML.Classes.Kernel.Element linkedSupplierFeature = this.getLinkedFeature(false) as UML.Classes.Kernel.Element;
                if (linkedSupplierFeature != null)
        return returnedElements;
      set { throw new NotImplementedException(); }
    private UML.UMLItem getLinkedFeature(bool start)
          string styleEx = this.wrappedConnector.StyleEx;
          string key;
          UML.UMLItem linkedFeature = null;
               if (start)
                key = "LFSP=";
                     key = "LFEP=";
               int guidStart = styleEx.IndexOf(key) + key.Length ;
               if (guidStart >= key.Length)
                string featureGUID = styleEx.Substring(guidStart,this.WrappedConnector.ConnectorGUID.Length);
                linkedFeature = this.model.getItemFromGUID(featureGUID);
          return linkedFeature;



You can't extend BPMN as that is already an extension to UML.
You can only extend EA's native types. UML and some EA specific elements such as requirements.

If you want to create a profile on top of BPMN you'll have to recreate it completely.

I believe there are ways to reverse engineer the BPMN profile, but I don't know how.


2 remarks:
1) Yes indeed, if you need to select something, use the construct picker.
2) If you are building a treeview you shouldn't try to fetch the whole tree at the initialisation. I would suggest to only get the first level of packages, and then get the second level when a user actually opens a package. See the principle of "lazy loading".


Two things to check

- Did your updates really go through? Do you see the changed values in the database
- Did you reload the diagram after your updates?



Since Windows 7 (or Vista maybe?) it is no longer allowed to create files on the C: root without elevated access.
You better create a directory to do your testing such as
C:\Test, so you can test the filename "C:\\Test\\test.txt" or variants thereof.


You know the issue is not just limited to UML. Its the difference between 'Modeling' and 'Drawing'.

@Geert - I really liked that post - have you put it on the Community site? We should get some T Shirts made up for it!
Thanks, yeah, it is a nice T-shirt slogan isn't it ;D

No not on the community site, in general they (Scott H.) don't like topics that are not specific to EA.
So you'll find some of my EA specific topics on the community site, but not the general UML stuff.



Only UML Elements can own other UML Elements.
Since Diagrams are no UML Elements they cannot own anything.

You need to think otherwise:
What does your Business Process Diagram represent? A Business Process?
In that case it would be logical to nest the Diagram under the element it represents.
then if you add an Activity on this diagram, it would automatically become an owned element of your business process, which probably is what it should be.

Diagram are not really a part of your model, they just provide some convenient way of reading/editing your model.
(see also my rant UML is NOT about diagrams!)


Pages: 1 ... 478 479 [480] 481 482 ... 572