Book a Demo

Recent Posts

Pages: 1 ... 7 8 [9] 10
81
You DA MAN!

My "real" SQL driver for the export of "connectors" is this:
Code: [Select]
select  rel.ea_guid
from    t_diagram diag,
        t_diagramlinks dl,
        t_connector rel,
        t_diagramobjects sdo,
        t_diagramobjects edo
where   diag.Diagram_ID = dl.DiagramID
and     diag.Diagram_ID = sdo.Diagram_ID
and     diag.Diagram_ID = edo.Diagram_ID
and     instr(diag.PDATA, 'HideRel=1') = 0
and     dl.ConnectorID = rel.Connector_ID
and     rel.Start_Object_ID = sdo.Object_ID
and     rel.End_Object_ID = edo.Object_ID
and     dl.Hidden = 0
and     rel.Connector_Type in ('Aggregation', 'Association', 'Generalization')
and     diag.ea_guid in ('{81D3FBA1-4F3F-4141-88C6-4CDACBB8DEB0}')

Guess I have to tweak the code to find all diagrams that have both classes, and force a save. Saving the diagram seems to be the only way to make it "stick"
82
Diagramlinks are not automatically created for each new connector.
This happens only when the diagram is opened.

So your query should be: all relations between all tuples of elements shown on the diagram, minus the relations that are hidden in the diagram (diagramLink.Hidden = 1)

Geert
83
Hi all...can't seem to figure this one out.

I run the exact code in the vbscript example outlines to create a new "Association" connector between two elements within my model.

My test diagram actually shows the connector named "test link 2".

When running the following sql to get the "links" on the diagram, the newly created connector is not in t_diagramlinks:
Code: [Select]
select  dl.*
from    t_diagram diag,
        t_diagramlinks dl
where   diag.Diagram_ID = dl.DiagramID
and     diag.ea_guid in ('{81D3FBA1-4F3F-4141-88C6-4CDACBB8DEB0}')

Anyone have any clues? Our modelers work within the diagram space, and do import/export work based upon information exported via code which creates a s/s based on diagram visibility, so this newly created connector will not be included in the report.

Thanks in advance...Eric
84
Thanks...I was afraid of that ;)

Will work through it...also need to be able to update source and target classes on a given connector, without changing the underlying GUID. Playing around, and I was able to change the target to another class. I will continue to play, to see if I can change the source to another class as well.

E
85
It's quite simple. You can only create new EA objects by calling the AddNew method on the EA.Collection of their parent.

For connectors, you add them to the source element, and then update the supplierID. (the ClientID is automatically filled in by EA)

In theory, I guess you could add the connector to any EA.Element.Connectors collection and then update both ClientID as SupplierID I guess.
Not sure why you would want to do that though.

A connector is not "owned" by the source or target element. It will indeed show up in both Connectors collection.

Geert
86
Hi all,

I am trying to automate importing relationships between classes.

Looking at the code snippet, the example shows the connector object being added to the source class:

Code: [Select]
Set con = source.Connectors.AddNew("test link 2", "Association")[

Just curious whether that is absolutely necessary to add it first to the element, or can I just create a "new" connector, and then update the client and supplier ends after.
In other words, is the connector actually owned by one of the ends, or is the example just showing one way? When I debug the actual source and target elements, I see the connector associated to both, in their respective "Connectors" property.

TIA...Eric
87
You could use:
Repository.GetTreeSelectedObject() and
RepositoryGetTreeSelectedItemType() to check if you have a diagram selected in the browser and then get the name of the browser selected object.
88
General Board / Re: Stereotyped connector from MDG into Relationship Matrix
« Last post by amacara1 on April 14, 2026, 05:03:33 pm »
Thank you, I have managed to do it, for both an element and a connector.
At least for me it was difficult to understand that 'Block' (in pointed to EA documentation) is not a keyword, but the name of the stereotype (or whatever name you'd like else) as one likes to have it displayed in EA.
90
General Board / Stereotyped connector from MDG into Relationship Matrix
« Last post by amacara1 on April 09, 2026, 11:50:30 pm »
I would like to have my stereotype connector (that I've created and imported from an MDG) into the 'Link Type' dropdown of a Relationship Matrix. I would like to use it to bulk-add a relation between multiple elements.
Is this possible, please, do you know how to do this?
Pages: 1 ... 7 8 [9] 10