Help to create activity diagram

0 votes
asked Sep 28, 2022 in Question / help by J.B.

Hello!
I hope you can help me to create an activity diagram, which looks like this

https://www.directupload.net/file/d/6686/ub6nwqjm_png.htm

The best solution I found is this:

@startuml
title Conditional - Activity Diagram
start
repeat :Check for config;
if (Config Available?) then (true)
else (no)
  :New Config?;
endif
:Load;
repeat while (Successful?) is (No) not (Yes)
stop
@enduml

and looks like this:

https://www.directupload.net/file/d/6686/kxgxlejv_png.htm


But this is not correct. The arrow Successful -no-> has to go to "new Config" and not "Start".
https://www.directupload.net/file/d/6686/27utm5g3_png.htm

What is the correct syntax to create the activity diagram I want to have? ;)

Thanks for your help!

Best regards,
J.B

commented Sep 28, 2022 by The-Lu (67,080 points)

Hello J.B., and all,

Here is an attempt with `goto`, dummy label, and dummy action:

@startuml
title Conditional - Activity Diagram
start
:Check for config;
if (Config Available?) then (No)
  label nc
  :New Config?;
else (Yes)
  :<i>Goto Load...} 'dummy action
endif
:Load;
'repeat while (Successful?) is (No) not (Yes)
if (Successful?) then (Yes)
else (No)
  label dummylabel
  goto nc
endif
stop
@enduml

But that is not conclusive.
@PlantUML: for a `goto` improvement....

If that can help, (a little... laugh)
Regards.

commented Sep 28, 2022 by J.B.

Hello The-Lu,

thanks for your reply.

You have a good idea, however the result also doesn't look as I expected. I would even almost say that the graphics are not really beautiful either. But this is not your fault. I looks like it's just impossible to create a simple graph which looks ike this

https://www.directupload.net/file/d/6686/ub6nwqjm_png.htm

So I hope that there will be an update to support such a feature in the next version of PlantUML! ;)

Many thanks in advance!

Best regards,
J.B.

commented Sep 28, 2022 by The-Lu (67,080 points)

Hello J.B., and all,

For that you can use legacy Activity as:

@startuml
title Conditional - Activity Diagram
(*) --> "Check for config"
if "Config Available?" then 
  -->[Yes] "Load"
else 
  -->[No] "New Config?"
  -r-> "Load"
endif
if "Successful?" then
  -->[Yes] (*)
else 
  -->[No] "New Config?"
endif
@enduml

Regards.

commented Sep 29, 2022 by J.B.
Super! Thank you! Looks much better!

I think I will use your proposal, even it's not 100% perfect ;)

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.
...