Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: elr on September 15, 2024, 10:08:22 am
-
Hello all,
I'm setting a customized MDG techno for office management with classes based stereotypes. For example, I created an Event element embedding a EventType Tagged Value (Meeting, Interview, Appointment, Seminary and so on)
As it works fine when I drag it from my Toolbox to an empty stereotyped diag (thx Phil Chudley) I wonder if that would be possible to instanciate this Event stereotype not as classe but as an object (maybe onto another stereotyped object diagram ?) that would easily represent each occurence of event.
I feel that setting the TV would be an issue....
Will I need to step back and build each event type as a stereotype
Thank you for your help
Eric
-
Eric,
You should probably create another stereotype for an eventType instance. You can then add the tagged values that are relevant for the instance on that stereotype.
On the EventType stereotype you can indicate which stereotype is to be used for instances.
Geert
-
Hi Geert and one more time thank you for you time !
You should probably create another stereotype for an eventType instance
Does it means that my toolbox would propose EventTime and EventTimeInstance icons ?
On the EventType stereotype you can indicate which stereotype is to be used for instances.
Unfortunately, I don't master more than that P.Chudley shows in its Getting the best out of an MDG video
:(
Finally solution seems not linked to diagram's types or properties. But, when you drag a class onto a diagram,what makes it show or not a window to choose between a link or instance ?
Eric
-
Does it means that my toolbox would propose EventTime and EventTimeInstance icons ?
Depends on what you put on your toolbox. You could leave only EventTime, and create the instances by dragging an existing EvenTime element on the diagram (holding Ctrl if needed)
Geert
-
You can control which element is intanciated via a profile property. Currently offline, but it's one of the "_" properties. (_instance or so...)
q.
-
Thank you two !
@Geert: Ctrl+Drag seems clean but I actually I get metaclass icon instead of stereotype one :(
@qwerty : I suppose that's a diagram property... I'll check it out but I'm afraid I'll then get the same glitch (default object icon)
So my work is not over if I want to get both class and object
-
It's _instanceType (not sure about case sensitivity, but that's how it' in our profile). Assign the initial value the metatype you want it to be on instantiation. As always it's a lot of trial and error with EA. The help is also a bit helpless, but more than nothing: https://sparxsystems.com/enterprise_architect_user_guide/17.0/modeling_frameworks/defining_behavior_on_creating_.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/modeling_frameworks/defining_behavior_on_creating_.html)
q.
-
You can set that using the profile helper as well. No chance of typing it wrong.
In fact you can set almost any property using the profile helper. Only a few exceptions.
Geert
-
Hello and thank you two,
I experimented _instanceType property by setting its value to _metatype value defined for my stereotype (I hope to be clear...). Drag'n Drop an element from the browser window let me opt an instance of my stereotyped class. But then:
1. I don't catch the difference (aspect and behavior) with creating many times stereotyped elements :
EventType1.Date=date1, EventType2.Date=date2, EventType3.Date=date3...
vs
date1:EventType1, date2:EventType1, date3.EventType1...
(not sure I'm still clear :-[ )
2. There is no visual difference unlike Standard UML profile that underlines name and sets to blue each instance's background.
What I was first expecting was to drag'n drop my stereotyped element directly from a Toolbox (maybe in a specifically configured diagram's stereotype) to instantly get a recolored instance of it, pre-fixed with <instance_name> and post-fixed with:<Element_name>
...Thx for reading :)
Eric
-
Yes, not sure what your issue is. However, if you ctrl-drag from the toolbox, EA asks you whether you want to create the element or its instance. Without the ctrl it's kind of game what EA does. (for me it's obvious and I eventually delete the new element, redoing it with the ctrl)
q.
-
Hi qwerty,
In my case, D'nD and Ctrl+D'nD from Toolbox do exactly the same :( It places an exemplary (instance ?) of the element I chose, with an incremented serial number.
https://sparxsystems.com/forums/smf/index.php?topic=37874.0 (https://sparxsystems.com/forums/smf/index.php?topic=37874.0)
Maybe my answer could come from recovering this feature...
???
Eric
-
In my case, D'nD and Ctrl+D'nD from Toolbox do exactly the same
I think there's been a bit of a mix-up. The Ctrl+Drag function is available when dragging an element from the Browser, not from the Toolbox.
If you want to create the instance, put the instance type on your toolbox.
-
That's right. I'm no longer a permant EA user and remembered it wrongly.
q.
-
Thank you Eve !
and no problem, qwerty. I suspected the mix-up, but the thread I referred, made it as well..
:)
Eric