Go directly to the end on Activity diagram

0 votes
asked May 4 in Question / help by eduardomozart (540 points)
Hello, I have the following diagram:

@startuml
start
:Entrada do pacote no iptables;
partition "Fechada a política de entrada (linha 1)" {
  if (O pacote que entra vem de 10.0.0.1? (linha 2)) then (SIM)
    :Rejeitado;
    ' kill
  else (NÃO)
    if (O pacote vem de 10.0.0.2 e é destinado à porta 80 tcp? (linha 3)) then (SIM)
      :Aceito;
      ' kill
    else (NÃO)
      if (O pacote vem da rede 172.20.0.0/16? (linha 4)) then (SIM)
        :Aceito;
        ' kill
      else (NÃO)
        :Rejeitado (não satisfaz à nenhuma regra);
      endif
    endif
  endif
}

stop
@enduml

I would like to remove the diamond (choose - red squares on image below) and go directly to the end (red arrow).

https://ibb.co/jkG9H1sK

1 Answer

+1 vote
answered May 4 by The-Lu (85,820 points)
selected May 5 by eduardomozart
 
Best answer

Hello E.,

Here is a proposal using label/goto, like:

@startuml
start
:Entrada do pacote no iptables;
partition "Fechada a política de entrada (linha 1)" {
  if (O pacote que entra vem de 10.0.0.1? (linha 2)) then (SIM)
    label dummy
    :Rejeitado;
    label l
    ' kill
  else (NÃO)
    if (O pacote vem de 10.0.0.2 e é destinado à porta 80 tcp? (linha 3)) then (SIM)
      :Aceito;
      goto l
      ' kill
    else (NÃO)
      if (O pacote vem da rede 172.20.0.0/16? (linha 4)) then (SIM)
        :Aceito;
        goto l
        ' kill
      else (NÃO)
        :Rejeitado (não satisfaz à nenhuma regra);
        goto l
      endif
    endif
  endif
}
label dummy
stop
@enduml

If that can help,
Regards,
Th.

commented May 5 by eduardomozart (540 points)
It seems great! There's a way to change the label line color to dark?
commented May 5 by The-Lu (85,820 points)

There's a way to change the label line color to dark?

Currently this is not possible.

But it is on the list of wanted features:

Regards,
Th.

commented May 5 by eduardomozart (540 points)
I see. Thank you!
commented Jun 3 by The-Lu (85,820 points)

Hello E.,

There's a way to change the label line color to dark?

Yes, from the [last] version v1.2025.3, the goto lines take the color of the other lines, like:

And if you want to change the color, you can use:

<style>
goto {LineColor red}
</style>

See ref.:

Enjoy,
Regards,
Th.

...