Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Clemo on June 26, 2014, 06:18:28 pm
-
Hi,
Think this may be a beginner question so apologies.
I have created a profile that has two constructs (A & B) that can be connected via a relationship R. Relationship R can only go from A->B, B->A is not allowed.
I have created the relation using an association with direction:source->destination.
How do I now use the Java api to check that relationship R is going from A->B and not B->A
Thanks
Clemo
-
i would say
that a connector is defined as a type (association for example), a clientID and a supplierID
if you know the elementID, just see if the element is the client or the supplier
in your example supplier would be A and client B
-
Thanks for the quick response and so obvious!
-
I really must be doing something wrong as I have done what has been suggested and irrespective of which way the relationship is directed I get the same output
elementId = 11
source = A(7), has destination = B(11)
I would have expected the source and destination to swap over when the direction of the relationship changes but it appears they did not!
Anybody any ideas because now I am really confused, do I need to do anything in the profile definition to ensure the source and destination are directional?
Clemo
-
Some connectors such as a generalization can only be directional.
The Direction dropdown is disabled.
Maybe you can figure out what triggers this behavior and then apply that on your connector?
Geert
-
Thanks for the information I am making an assumption that because the association has an arrow at one end of the association and that in the definition the direction states source->destination that the association is directional.
Is this a wrong assumption, as I am creating my own profile I do have the option of using another connector type although would prefer not too.
Regards
Paul
-
Using the quick linker you are able t create either source->target as well as target->source connectors.
q.
-
Thanks for the reply.
The relationship I am tying to use has been defined in my bespoke profile (stereotype of an association) as part of the toolbox for the diagram.
I am then selecting that relationship and attaching it to two of my constructs, the association seems to be showing as a directed association but I do not appear to be able to work out which is the source and which is the destination.
I am guessing its an issue with the way I am defining the relationship in my profile but cannot see what to do.
Thanks
Clemo
-
Hi,
I have been looking at the quick linker as suggested (seems exactly what I want!) but I do not seem to be able to get it to work. My line looks like this:
A=Class
B=A
C=Class
D=B
E
F
G
H=Association
I
J=directed
K=R(the relationship)
L
M=TRUE
N
O
P
Q=n-ary Association also tried BCM
R=0
S
T
U
V
Anybody spot what I am doing wrong?
Thanks
Clemo
-
It's really fiddly twiddly with the QL. You have to go through a couple of trial and error cycles. Try to use an existing matrix and make little changes to see how it reacts. Very tedious and unforgiving :(
q.
-
Hi,
I have been looking at the quick linker as suggested (seems exactly what I want!) but I do not seem to be able to get it to work. My line looks like this:
A=Class
B=A
C=Class
D=B
E
F
G
H=Association
I
J=directed
K=R(the relationship)
L
M=TRUE
N
O
P
Q=n-ary Association also tried BCM
R=0
S
T
U
V
Anybody spot what I am doing wrong?
Thanks
Clemo
If I understand you correctly, keep that row in your quicklinker definitions and add a second row from Class B to Class A with direction set to "from" instead of "directed". Then when you drag a quicklink from A to B it will create an Association from A to B, and when you drag a quicklink from B to A it will create an Association from A to B.
-
Thanks guys, nearly there :)
Last issue is the link being created does not seem to be being set to my stereotype which I thought column K would do, is there some other column that I need to populate?
Fiddly I agree but now I have discovered it, looks incredibly useful.
Clemo
-
Thanks guys, nearly there :)
Last issue is the link being created does not seem to be being set to my stereotype which I thought column K would do, is there some other column that I need to populate?
Fiddly I agree but now I have discovered it, looks incredibly useful.
Clemo
Column I for the new link stereotype. Column K is the text that gets displayed on the menu.
-
Thanks, I think much of the problem with the quick linker I have had is that it appears you have to restart EA to get the changes in your quick linker artifact to take place, its not just a question of rebuilding the profile.
Is that correct or is there a way around this?
Paul
-
You can unload/load the MDG which (now) does the same job. But I found out that closing/reopening is usually faster than that.
q.