Unable to add arrow text description after backward keyword.

0 votes
asked Oct 4, 2020 in Question / help by wro02922 (760 points)

Is it possible to insert arrow text between "Warning" and "Foo" objects?

I cannot add an arrow text after backward keyword (dsc_4 overwrites dsc_3).

@startuml
start
->dsc_1;
repeat :foo;
->dsc_2;
:Submit;
->dsc_3;
backward :Warning; 
->dsc_4;
repeat while (Valid?) is (No) not (Yes)
->dsc_5;
stop
@enduml

PlantUML diagram

2 Answers

0 votes
answered Oct 4, 2020 by plantuml (257,940 points)
selected Oct 6, 2020 by wro02922
 
Best answer
This should not be too difficult to implement.

The most difficult part is to find a nice syntax and we are out of inspiration here :-)

Any suggestion ? Feel free to post some possible syntax examples!

Thanks
commented Oct 5, 2020 by wro02922 (760 points)

1. The description of the arrow to the 'backward' action is correctly located, i.e. dsc_4 should not overwrite dsc_3, which is related to the 'Submit' action.
2. The description back to the 'foo' action can be executed as for elsif, i.e.
(incoming description) elseif (condition) else (outgoing description)
3. I would apply the same approach to the while loop.
P.S.
If you find time, it would be worth updateing the elseif description in help, i.e. at the moment (incoming description) elseif is undocumented.

@startuml
start
->dsc_1;
(incoming description from backward) repeat :foo;
->dsc_2;
:Submit;
->dsc_3;
backward :Warning; 
->dsc_4;
repeat while (Valid?) is (No) not (Yes)
->dsc_5;
stop
@enduml


@startuml
start
->dsc_1;
(incoming description from backward) while (data available?)
  ->dsc_2;
  :read data;
  ->dsc_3;
  :generate diagrams;
  ->dsc_4;
backward :Warning; 
->dsc_5;
endwhile
stop
@enduml

Thanks

commented Oct 6, 2020 by plantuml (257,940 points)

Sure, you are right about point 1 :-)

This has been fixed with last beta http://beta.plantuml.net/plantuml.jar and on the online server.

For the other points, it would be nice if you could open new issues for each one. Thanks!

commented Oct 6, 2020 by wro02922 (760 points)
Many thanks. I will open a new feature requests.
0 votes
answered Oct 12, 2020 by plantuml (257,940 points)

We are still looking for a clear syntax.

With last official release, you have to use:

@startuml
start
->dsc_1;
repeat :foo;
 ->dsc_2;
 :Submit;
 ->dsc_3;
(->incoming) backward :Warning; (->outcoming)
repeat while (Valid?) is (No) not (Yes)
->dsc_5;
stop
@enduml

Any feedback welcome :-)

commented Nov 3, 2020 by R

For me the clearest syntax would be, if it started on the same line as repeat while:

@startuml
start
->dsc_1;
repeat :foo;
 ->dsc_2;
 :Submit;
 ->dsc_3;

repeat while (Valid?) is (No) then
'This is the backward path
->incoming;
:Warning;
->outcoming;
else (Yes)
->dsc_5;
stop
@enduml

Another possibility is to use everything below the backward keyword to the repeat while keyword:

(->incoming) backward :Warning; (->outcoming)
repeat while (Valid?) is (No) not (Yes)

'will become

backward
->incoming;
:Warning; 
->outcoming;
repeat while (Valid?) is (No) not (Yes)

 Both have the advantage, that we can "access" all arrows and define multiple actions on the backward path.

...