umlplantumlcomponent-diagram

PlantUML component diagam port


Is there any possible way to create component port in the component diagram?

If port has to be attached to only one arrow, its easy, because I can use #-- arrow.

interface y
[x] #- y

The problem is, if I try to attach to arrows to one port. I tried to use rectangle, but its not on the border then.

rectangle " " as P
[Component] - P

interface I1
interface I2

P - I1
P -- I2

Do you know any better workarounds?


Solution

  • Although a bit late for TO perhaps helpful for someone else.

    I managed to create ports on components with the following approach:

    @startuml
    skinparam componentstyle uml2
    left to right direction
    
    component X {
        port " " as x_out
    }
    
    'u for layouting it more nicely, 0) for lollipop
    x_out -u0)- [Y]
    x_out -u0)- [Z]
    
    @enduml
    

    However I experienced a bad layout of the port itself, means when a component has several ports it will start looking messy. But hey at least its a port with multiple connections.

    Result looks like:

    enter image description here