Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: gunterkoenigsmann on February 26, 2024, 11:29:41 pm
-
I have used knowledge from this forum for many shape scripts, already. But now I have a question that exceeds what I found out widely: I want to create a stereotype that
- ideally comes with its own tag (like the FlowPort stereotype does come with a direction tag)
- that changes the line color of the ports it affects and
- that can be combined with other stereotypes like flowport (that does change the port decoration) or a stereotype that only changes the background color
What I know is:
- how to create my own stereotypes via configure/UML types(but not how to bundle them with a tag).
- That I can draw a stereotype into a diagram and add tags to it. But then I don't know how to apply that stereotype to a port.
- If I don't use a shape script I know the buttons that change the colors in a way that plays well with other stereotypes. Also I know how to make the shape script react to tagged values.
But all that combined doesn't add up to what I think I need...
-
- ideally comes with its own tag (like the FlowPort stereotype does come with a direction tag)
https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/definestereotypetags.html (https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/definestereotypetags.html)
- that changes the line color of the ports it affects and
https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/example_scripts.html (https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_frameworks/example_scripts.html)
Examples of both checking a tag and setting a color.
- that can be combined with other stereotypes like flowport (that does change the port decoration) or a stereotype that only changes the background color
That could be hard since only one shape script will draw.
Based on that I'll recommend an alternative. Using a legend to colour your elements based on the tagged value created based on the first link.
https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_fundamentals/add_a_legend.html (https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_fundamentals/add_a_legend.html)
-
Tested it for a few days now and legends work fine. Thanks a lot!