Symbols for activities in activity diagrams and composite state in state diagrams

0 votes
asked 5 hours ago in Wanted features by Marcelo

Spoiler for readers: Contains workarounds. ;-)

Hi! I want to request (and contribute to) features regarding activity diagrams and state diagrams.

When designing/coding in PlantUML, I miss something to visually represent activities (in UML activity diagrams) and composite states (in UML state diagrams), as described in the official UML specification.

I created two sprites as workarounds for representing them, but it would be easier to use something like them integrated to PlantUML, so we don't have to add them every time we need them. I'm not saying they should be integrated "as-is" officially, but it's a starting point or just an inspiration :-D

To show the difference between actions and activities in activity diagrams, there's that rake-like symbol. Based on the contributions provided on GitHub (last one by rodbcor). this is the code I'm using.

' CallBehaviorAction

' (rake-like symbol to differentiate activity from action)
' (adapted from https://github.com/plantuml/plantuml/discussions/1066)
' SVG adapted from https://www.svgrepo.com/svg/412621/harvest
' (https://www.svgrepo.com/show/412621/harvest.svg)
sprite callBehaviorAction <svg viewBox="0 0 32 32" xml:space="preserve">
<path d="M26,14v14h-4V18h-4v10h-4V18h-4v10H6V14h8V4h4v10H26z"/>
</svg>
' Example of use (put as much space as needed to align the symbol):
':   Activity name\n                        <$callBehaviorAction{scale=0.5}>;

To show the difference between simple states and composite states in state diagrams, there's that glasses symbol. Based on the contributions provided on GitHub, this is the code I'm using.

' CompositeState

' (glass-like symbol to differentiate simple and composite states)
' SVG based on the UML composite-state notation, supported by ChatGPT
sprite compositeState <svg viewBox="0 0 64 32" xml\:space="preserve">
<path fill-rule="evenodd" d="M6.8,8.5h13.6c2.82,0,5.1,2.28,5.1,5.1v6.8c0,2.82-2.28,5.1-5.1,5.1H6.8c-2.82,0-5.1-2.28-5.1-5.1v-6.8c0-2.82,2.28-5.1,5.1-5.1zM6.8,11.9c-0.94,0-1.7,0.76-1.7,1.7v6.8c0,0.94,0.76,1.7,1.7,1.7h13.6c0.94,0,1.7-0.76,1.7-1.7v-6.8c0-0.94-0.76-1.7-1.7-1.7H6.8zM40.8,8.5h13.6c2.82,0,5.1,2.28,5.1,5.1v6.8c0,2.82-2.28,5.1-5.1,5.1H40.8c-2.82,0-5.1-2.28-5.1-5.1v-6.8c0-2.82,2.28-5.1,5.1-5.1zM40.8,11.9c-0.94,0-1.7,0.76-1.7,1.7v6.8c0,0.94,0.76,1.7,1.7,1.7h13.6c0.94,0,1.7-0.76,1.7-1.7v-6.8c0-0.94-0.76-1.7-1.7-1.7H40.8zM25.5,15.3h10.2v3.4H25.5z"/>
</svg>

' Example of use (put as much space as needed to align the symbol):
'state "State name" : \n                        <$compositeState{scale=0.5}>

While these are not integrated as commands in PlantUML (if so), I hope this helps those with the same demands. ^^'

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...