英文:
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 "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 \npassword
user <- reseller_ui : Let user reset password
user -> reseller_ui : Complete the reset password
reseller_ui -> db : Check if TOTP secret \n key exists
reseller_ui <- db : TOTP secret key does \n not exist
user <- reseller_ui : Force user to setup Mobile App
else For existing user
user -> reseller_ui : Request to enable \ntwo-factor authentication (TFA)
user <- reseller_ui : Request user to input \npassword for authentication
user -> reseller_ui : Provide the correct password
end
reseller_ui -> reseller_ui : Generate secret \nkey for TOTP
reseller_ui -> db : Store the secret key \nfor that user
loop Until user input correct TOTP or cancel enable TFA
user <- reseller_ui : Display the secret key, \nas QR Code
user <- reseller_ui : Wait for user to input \nthe 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 \nkey directly
user <- reseller_ui : Display the secret key
user -> token : Input the secret \nkey directly
end
token -> token : Store the secret key
user -> token : Read the TOTP \ndisplayed in the app
user -> reseller_ui : Input the TOTP in app
reseller_ui -> db : Get the secret key \nof that user
reseller_ui -> reseller_ui : Validate the TOTP
alt If validation success
reseller_ui -> db : Mark the TFA \nsetup complete
user <- reseller_ui : Display successful message
else If validation not success
user <- 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()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论