The combination of while, if, note, and break statements does not draw the figure.

0 votes
asked Oct 25, 2021 in Question / help by pochi
Hello.
When I use a combination of while, if, note, and break statements, it looks like the diagram is not drawn.
Please point out if there is any mistake in my code.

http://www.plantuml.com/plantuml/uml/9Ov12W8n34NtESLVTfZDk7KKvYfLKnliPA2c29xUccv2NlBu_ErjiLhR2tso50wY1hakgrnEIv_pF140IGYu7vemmJ8hWjN6_e8UngZopEOux9vglBEE6-l3DOTp4er5lhmwtYh75mr94lrLRq9RNtkl7m00
commented Oct 25, 2021 by The-Lu (64,760 points)

Hello P.,

For note on 'if statement" see Wanted Request/Question here:

Regards.

2 Answers

0 votes
answered Oct 25, 2021 by The-Lu (64,760 points)

Hello P.,

  • Where do you want to put the note?

Here is another example:

@startuml
while(int i=0;i<100;i++)
   if ( conf ) then (true)
    :finalize;
    note right
       if statement
    end note
    break
   endif
end while
@enduml

If that can help,
Regards,
Th.

commented Oct 25, 2021 by anonymous
Hi The-Lu.
Thank you for replying.

>Where do you want to put the note?
I thought that if I put the note statement just below the if statement, the note would appear on the right side of the line where the if statement branches off.
I wrote the note statement just below the if statement in the while statement loop, and that's what happened.

http://www.plantuml.com/plantuml/uml/9Own2iCm34HtVSMD3bdIjMaXln9QkHOu2hWoXNvzXBmSEjr3kkrhUxD-LFeLgPn43V9SLddS5jTvdWY0P2IyJisOO8KLoLhdYA2dCPfyYeKTj5yrFbZ7ZlKTM9Xx5jsh_7cb4KacLyH_sdpqDXS0

However, I got an error when I did a break in a block with an if statement, so I don't know how to write it anymore.

http://www.plantuml.com/plantuml/uml/9Ov12W8n34NtESLVTfZDk7KKvYfLKnliPA2c29xUccv2NlBu_ErjiLhR2tso50wY1hakgrnEIv_pF140IGYu7vemmJ8hWjN6_e8UngZopEOux9vglBEE6-l3DOTp4er5lhmwtYh75mr94lrLRq9RNtkl7m00

Based on the sample you showed me, I thought it would be better to write the following

http://www.plantuml.com/plantuml/uml/9Ouz3i8m38Ltd-ADhRgKbOBKgmHmY4NgIi4L4gSds4lYd--ptlgsrEpOAdsAL1v43NAT5xcSvlvEqqW096F0VTUC4LPOCLWxs5SuO_5VTsCqUHRpDgn-tNXZZHdhmx7micYgykNGRutJYmAIJ7_K4z7Qovxl1m00

Instead of writing the NOTE right under the if statement, I create one dummy process and write the NOTE under it.
Thank you very much for your help.

Regards.
0 votes
answered Oct 25, 2021 by plantuml (295,000 points)
Thanks for the report.

We have fixed this in last beta http://beta.plantuml.net/plantuml.jar and on the online server.

At least, it does not crash.

The drawing is not perfect, still.
...