Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: jfranflorez on May 17, 2024, 05:38:34 am
-
Hi Everbody,
When one create a Composite Aggregation on a Diagram this automatically creates a Parts and it links the Role Name of the COmposite Aggregation with the name of the Part, such that if the Role Name is changed the part name is also changed.
I wish to have the above behavior but through a Script.
Currenlty I am creating parts first in the browser automatically via a VBA Script, but since parts created in the browser do not automatically create Composite Aggregations I proceed to create the composite aggregations per Script as well.
But the created parts and aggregation are not related to each other, so the the above mentioned role name changes in the aggregation reflect automatically in the part.
Does anybody now how one can tell EA, that a certain composite aggregation corresponds to a certain Part.
Thanks
Bo
-
Offline right now, but a Part is in t_object with PDATA1 containing the GUID of its classifier.
q.
-
Yes, but this is the relationship between the part and its classifier. What I want is to relate a part created via script , with a composite aggregation that was also created via scipt.
So an example:
If I have three Blocks Sys, SubSysA, SubSysB and draw composite aggregation relationships between them in EA, EA will automatically create parts under the Sys Block and EA will automatically relate a name change in the Composite Aggregation "Source Role" to the Name of the corresponding created Part
As soon as one draws the composite agreggations we get the Sys Block with two unnamed parts:
Sys
:SubSysA
:SubSysB
If one updates the source roles of the composite aggregations to ssA and ssB then EA automatically updates the names of the parts and one gets:
Sys
ssA:SubSysA
ssB:SubSysB
So the above example is the default behavior when modelling within the tool and now I wish to make this work via script.
What I do in my script is the following:
First I create the parts via Script and thus get:
Sys
ssA:SubSysA
ssA:SubSysB
Then I create the composite aggregations from Sys to SubSysA and from Sys to SubSysB.
Now the issue is that thevia script created composite aggregations are not related to the previously created parts, how can I tell EA, that those composite aggregations correspond to specific parts?