Implementation Nested Activity with plantUML

+2 votes
asked Mar 16, 2022 in Question / help by Elon
Hi, how do I get this implemented in plantUML?
Because I haven't found the implementation for plantUML.

https://stackoverflow.com/questions/49587971/can-i-create-a-nested-activity-diagram-in-uml

2 Answers

0 votes
answered Mar 16, 2022 by The-Lu (89,080 points)

Hello E.,

To achieve this:

Source:

You can use sub-diagram as:

@startuml
:Action 1;
: Activity 1
{{
mainframe Activity 1
start
:SubAction;
end
}}
;
:Action 2;
@enduml

If that can help,
Regards,
Th.

commented Mar 17, 2022 by Elon

Thank you. 

Can you tell me how to achieve something like that here?

commented Mar 17, 2022 by The-Lu (89,080 points)

Hello E.,

For that, you can use:

1/ Sprite, as:

@startuml
sprite $Invocation [16x16/16] {
0000000000000000
0000000000000000
0000000FF0000000
0000000FF0000000
0000000FF0000000
0000000FF0000000
0000000FF0000000
000FFFFFFFFFF000
000FF00FF00FF000
000FF00FF00FF000
000FF00FF00FF000
000FF00FF00FF000
000FF00FF00FF000
000FF00FF00FF000
0000000000000000
0000000000000000
}
start
:Action1;
:Action2:
Model2
\t\t<$Invocation>;
:Action3;
end
@enduml

Adapted from:

2/ or Unicode, as:

@startuml
start
:Action1;
:Action2:
Model2
\t\t₼;
:Action3;
end
@enduml

If that can help,
Regards,
Th.

0 votes
answered Apr 25, 2025 by Marcelo

Hello there,

A more scale-friendly alternative to the previous answers, using SVG:

' CallBehaviorAction (activity vs. 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 calBehaviorAction <svg viewBox="0 0 32 32" xml:space="preserve">
<path d="M26,14v14h-4V18h-4v10h-4V18h-4v10H6V14h8V4h4v10H26z"/>
</svg>
' Example of use
':Activity name\n                    <$calBehaviorAction{scale=0.5}>;
' Put as much space as needed so that the the symbol becomes correctly aligned.

start

:This is an action;
:The next element
   is an activity;
:An activity can be seen
as an abstraction level
  of a set of actions <$calBehaviorAction{scale=0.5}>;
:Hope that helps!;

stop

@enduml

...