Join two activity blocks into a single one

0 votes
asked Sep 29, 2021 in Question / help by Grolribasi (220 points)

Hello PlantUML!

I have a diagram that looks like this:

https://gifyu.com/image/XN6M

And the source code is the following:

@startuml
skinparam rectangleBorderThickness 1
|#orange|Registrar|
#lightgray:**Introduce document to the system**;
:Register Document;
if (Work on the document is required?) then (No)
#lightgray:**Archive document**;
end
else (Yes)
repeat
:Work on incoming documents;
|#green|Performer|
:**Perform tasks for the document**;
repeat while (Completed?) is (No) not (Yes)
|#orange|Registrar|
#lightgray:**Archive document**;
end
@enduml

As you can see, there are two activity blocks that look exactly the same:

|#orange|Registrar|
#lightgray:**Archive document**;
end

I would like to join them into one but I see no way of doing it. Can someone help me with this?

1 Answer

+1 vote
answered Sep 29, 2021 by The-Lu (63,920 points)
selected Nov 25, 2021 by Grolribasi
 
Best answer

Hello G.,

From:

with adding:

@startuml
skinparam rectangleBorderThickness 1
|#orange|Registrar|
#lightgray:**Introduce document to the system**;
:Register Document;
if (Work on the document is required?) then (No)
  ://Goto archive//;
  '#lightgray:**Archive document**;
  'end
else (Yes)
  repeat
  :Work on incoming documents;
  |#green|Performer|
  :**Perform tasks for the document**;
  repeat while (Completed?) is (No) not (Yes)
  |#orange|Registrar|
  '#lightgray:**Archive document**;
endif
#lightgray:**Archive document**;
end
@enduml

we can observed this result:

If that can help,
Regards,
Th.

commented Sep 29, 2021 by Grolribasi (220 points)

Unfortunately, this is not what I would like to see. This solution requires adding one more activity, this is not the logic that the diagram required to display. I guess, it would make sense to leave it like this:

@startuml
skinparam rectangleBorderThickness 1
|#orange|Регистратор|
#lightgray:**Ввод документа в систему**;
:Регистрация документа;
if (Требуется работа по документу?) then (НЕТ)
|#orange|Регистратор|
#lightgray:**Перевод документа в архив**;
detach
else (ДА)
repeat
:Обработка входящей корреспонденции;
|#green|Исполнитель задания|
:**Исполнение заданий по документу**;
repeat while (Завершено?) is (Нет)
detach
@enduml
commented Sep 29, 2021 by The-Lu (63,920 points)

In fact without adding one more activity, there is overlapping... crying

Regards,
Th.

commented Sep 29, 2021 by Grolribasi (220 points)

Yes, the overlapping is terrible and uncontrollable crying

commented Oct 4, 2021 by Martin (8,360 points)

You could replace the unwanted activity with a label...
(click diagram for online server)

commented Oct 5, 2021 by Grolribasi (220 points)
This is awesome! Where can I find more information about labels?
...