Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: mmontminy on February 16, 2019, 02:26:43 am
-
Hi,
I have created Stereotypes extending ArchiMate Stereotype. I've added tagged value to my Stereotypes. I've created Shape Script that based on the value of those tagged values will render the Stereotype differently. That works fine for the Stereotype itself. But when I create Instances of those Stereotypes, the tagged value is there and I can set it but the Shape Script is not executed.
Is there a way to do this?
Thanks!
-
I don't know Archimate('s MDG) but you'd probably need to extend also the corresponding Object for your stereotype.
q.
-
I didn't know you could do that (extend objects of a stereotype). How do you do that?
Also, tagged values which are attributes of my stereotype are "inherited" by the instances(objects) of my stereotype. The shape script attached to the "_image" Attribute of my stereotype is not used when displaying the objects. That doesn't really surprises me because all objects look like they are rendered as UML Class object.
-
I didn't know you could do that (extend objects of a stereotype). How do you do that?
The the diagram you created the stereotype add an object and link the stereotype with an extension relationship
I Also, tagged values which are attributes of my stereotype are "inherited" by the instances(objects) of my stereotype. The shape script attached to the "_image" Attribute of my stereotype is not used when displaying the objects. That doesn't really surprises me because all objects look like they are rendered as UML Class object.
You need a stereotype to extend the object to get the shapescript and tags. The step above will fix that.
You should end up with classes and objects with stereotypes.
By the way ArchiMate doesn't have the concept of instances but in order to create multiple objects of the same I used instances too.
For example system software like windows server 2016 in technology diagrams
-
In one of the properties of the stereotype you can define what their instances are.
By default they are UML objects.
Geert
-
"By the way ArchiMate doesn't have the concept of instances"
Archimate does have the concept of instances, through the Specialisation relationship. Use it all the time. Different thinking to UML Instantiated Objects, however. :-)
-
Hi,
I have created Stereotypes extending ArchiMate Stereotype. I've added tagged value to my Stereotypes. I've created Shape Script that based on the value of those tagged values will render the Stereotype differently. That works fine for the Stereotype itself. But when I create Instances of those Stereotypes, the tagged value is there and I can set it but the Shape Script is not executed.
Is there a way to do this?
Thanks!
This is what I'd like to be able to do. I haven't found any instructions on how to modify / extend the Archimate 3 MDG Technology. I'd like to be able to draw annotation markers on Archimate shapes (simple squares or circles) and fill them with simple colours and / or a few alphanum characters based on a the value of a tagged value settable for that object.
I'm sure someone has done this before, but I'm sadly not gifted at coding or scripting.
-
This is what I'd like to be able to do. I haven't found any instructions on how to modify / extend the Archimate 3 MDG Technology. I'd like to be able to draw annotation markers on Archimate shapes (simple squares or circles) and fill them with simple colours and / or a few alphanum characters based on a the value of a tagged value settable for that object.
For example
To specialise the ArchiMate 3 Driver to and ArchiMate Risk Driver you have the following relationships in your MDG
- ArchiMate Risk Driver extends class
- ArchiMate Risk Driver generalises ArchiMate3::ArchiMate_Driver
To do the shapescript tho' you enter the wiggity world of the third worst MDG shapescripting :-)
-
ArchiMate Risk Driver extends class
I'd no longer recommend that, and it's no longer in our help.
https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/non-uml_metatypes.html (https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/non-uml_metatypes.html)
I haven't seen a scenario where it caused anything good to happen in a while. (But I have seen it cause confusion about which metaclass extension to use etc)
To do the shapescript tho' you enter the wiggity world of the third worst MDG shapescripting :-)
You can probably avoid it if you call drawparentshape() in your script. Then you just draw what you want over the top (or outside the 0,0,100,100 rect of the original.)
-
In one of the properties of the stereotype you can define what their instances are.
By default they are UML objects.
Geert
I'v tried your suggestion and it seems to work very well. But there is a side effect I don't understand. The stereotype objects and there instances are now displayed with the full namespace. The diagram properties option to show or not namespace has no effect.
-
"By the way ArchiMate doesn't have the concept of instances"
Archimate does have the concept of instances, through the Specialisation relationship. Use it all the time. Different thinking to UML Instantiated Objects, however. :-)
Interesting take on that but I don't interpret specialisation as identifying an instance. To quote the 3.01 spec
As explained in Section 3.6, the ArchiMate language in general focuses on the modeling of types, not instances, since this is the most relevant at the Enterprise Architecture level of description...
Of course if you get 10 architects reading a spec you'll get 11 interpretations of it. One from the author and 10 from each of the architects
-
Actually I do both a high level diagram showing only ArchiMate type/stereotype and an instantiation of it that provide the actual implementation. The later one using instances. It's like a UML deployment diagram.
I'm happy with the high level version that falls into Enterprise Architecture scope. On the other hand, other stakeholders need the implementation version and Sparx E.A. support both rather nicely. Much better than doing it in Visio.
As per my problem with the namespace always displaying. I traced it to the shape script I wrote. The drawing methods drawparentshape and drawnativeshape behave very differently. I understand that I should be using drawparentshape as I am extending non-UML Object types. I still don't fully understand the behavior but getting closer.
Thanks all!
-
Actually I do both a high level diagram showing only ArchiMate type/stereotype and an instantiation of it that provide the actual implementation. The later one using instances. It's like a UML deployment diagram.
I create an archetypal diagram. And then I have elements realise the archetype. For example I will model Microsoft Exchange with a technology diagram as a single node with associated system software, interfaces, functions it al. Then the actual server nodes realise the Exchange archetype node.