将参与者添加到图表中间以提高可见性。

huangapple go评论56阅读模式
英文:

Add participants to middle of diagram for visibility

问题

I want to know if it's possible to add the participants to the middle of a large diagram, so it's easy to see what line each participant is without having to scroll to the top or bottom.

For example a diagram like so; When rendered it's easy to lose track of what vertical line is what participant.

In this example, it would be nice to add the participants again at point 10 / 11 to continue the flow

autonumber

participant "Mobile App" as token
actor User as user
participant "Reseller UI" as reseller_ui
participant "Database" as db

alt For new user
    user -> reseller_ui : Visit the link provided to reset 
    password
    user <- reseller_ui : Let user reset password
    user -> reseller_ui : Complete the reset password
    reseller_ui -> db : Check if TOTP secret 
 key exists
    reseller_ui <- db : TOTP secret key does 
 not exist
    user <- reseller_ui : Force user to setup Mobile App
else For existing user
    user -> reseller_ui : Request to enable 
 two-factor authentication (TFA)
    user <- reseller_ui : Request user to input 
 password for authentication
    user -> reseller_ui : Provide the correct password
end
reseller_ui -> reseller_ui : Generate secret 
 key for TOTP
reseller_ui -> db : Store the secret key 
 for that user
loop Until user input correct TOTP or cancel enable TFA
    user <- reseller_ui : Display the secret key, 
 as QR Code
    user <- reseller_ui : Wait for user to input 
 the TOTP from Mobile App
    alt For Mobile App supports QR Code
        token -> reseller_ui : Decode the QR Code displayed
    else For Mobile App does not support QR Code 
        user -> reseller_ui : Request to display the secret 
 key directly
        user <- reseller_ui : Display the secret key
        user -> token : Input the secret 
 key directly 
    end
    token -> token : Store the secret key
    user -> token : Read the TOTP 
 displayed in the app 
    user -> reseller_ui : Input the TOTP in app 
    reseller_ui -> db : Get the secret key 
 of that user
    reseller_ui -> reseller_ui : Validate the TOTP
    alt If validation success
        reseller_ui -> db : Mark the TFA 
 setup complete
        user <- reseller_ui : Display successful message
    else If validation not success
        user <- reseller_ui : Display failure message
    end
end

将参与者添加到图表中间以提高可见性。

英文:

I want to know if it's possible to add the participants to the middle of a large diagram, so it's easy to see what line each participant is without having to scroll to the top or bottom.

For example a diagram like so; When rendered it's easy to lose track of what vertical line is what participant.

In this example, it would be nice to add the participants again at point 10 / 11 to continue the flow

@startuml
autonumber

participant &quot;Mobile App&quot; as token
actor User as user
participant &quot;Reseller UI&quot; as reseller_ui
participant &quot;Database&quot; as db

alt For new user
    user -&gt; reseller_ui : Visit the link provided to reset \npassword
    user &lt;- reseller_ui : Let user reset password
    user -&gt; reseller_ui : Complete the reset password
    reseller_ui -&gt; db : Check if TOTP secret \n key exists
    reseller_ui &lt;- db : TOTP secret key does \n not exist
    user &lt;- reseller_ui : Force user to setup Mobile App
else For existing user
    user -&gt; reseller_ui : Request to enable \ntwo-factor authentication (TFA)
    user &lt;- reseller_ui : Request user to input \npassword for authentication
    user -&gt; reseller_ui : Provide the correct password
end
reseller_ui -&gt; reseller_ui : Generate secret \nkey for TOTP
reseller_ui -&gt; db : Store the secret key \nfor that user
loop Until user input correct TOTP or cancel enable TFA
    user &lt;- reseller_ui : Display the secret key, \nas QR Code
    user &lt;- reseller_ui : Wait for user to input \nthe TOTP from Mobile App
    alt For Mobile App supports QR Code
        token -&gt; reseller_ui : Decode the QR Code displayed
    else For Mobile App does not support QR Code 
        user -&gt; reseller_ui : Request to display the secret \nkey directly
        user &lt;- reseller_ui : Display the secret key
        user -&gt; token : Input the secret \nkey directly 
    end
    token -&gt; token : Store the secret key
    user -&gt; token : Read the TOTP \ndisplayed in the app 
    user -&gt; reseller_ui : Input the TOTP in app 
    reseller_ui -&gt; db : Get the secret key \nof that user
    reseller_ui -&gt; reseller_ui : Validate the TOTP
    alt If validation success
        reseller_ui -&gt; db : Mark the TFA \nsetup complete
        user &lt;- reseller_ui : Display successful message
    else If validation not success
        user &lt;- reseller_ui : Display failure message
    end
end

@enduml

将参与者添加到图表中间以提高可见性。

答案1

得分: 1

找到了在PlantUML中这不是一个可能的特性。可以做的最接近的事情是这样的:

!procedure $insert_participants()
rnote over token : 移动应用
/rnote over user : 用户
/rnote over reseller_ui : 经销商用户界面
/rnote over db : 数据库
!endprocedure

然后在你想要再次显示参与者的图表中调用该函数。

$insert_participants()
英文:

Found out this isn't a possible feature in PlantUML. The closest thing that can be done is this;

!procedure $insert_participants()
rnote over token : Mobile App
/rnote over user : User
/rnote over reseller_ui : Reseller UI
/rnote over db : Database
!endprocedure

then in the diagram where you wan to show the participants again you call the function.

$insert_participants()

huangapple
  • 本文由 发表于 2023年2月14日 05:02:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/75441151.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定