如何以序列图显示流程终止
基本上,我想在序列图中描述以下逻辑:
if (ShopIsOpen) {
if (AccessTokenIsExpired) {
if (RefreshTokenInExpired) {
return "Not Authorized";
}
IdentityServer.RequestAccessTokenByRefreshToken();
return Resource.RequestResourceByAccessToken();
}
} else {
return "Shop is closed";
}
我想出了以下图,但是我不确定它是否正确。 主要是,我不确定break
是否正确地传达了终止流的意图:它是否意味着跳出外部opt> opt
或ofter alt alt ?
任何帮助都非常感谢。
Basically, I'd like to depict the below logic in a Sequence Diagram:
if (ShopIsOpen) {
if (AccessTokenIsExpired) {
if (RefreshTokenInExpired) {
return "Not Authorized";
}
IdentityServer.RequestAccessTokenByRefreshToken();
return Resource.RequestResourceByAccessToken();
}
} else {
return "Shop is closed";
}
I've come up with the below diagram, but I am not sure if it is correct.
Mainly, I am not sure if break
in the diagram correctly communicates the intention of termination of flow: does it imply jumping out of the outer opt
or the outer alt
?
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
断开片段
离开了立即封闭的片段。在您的情况下,这将是选择片段
。因此,这是不正确的。您为什么不使用嵌套alt Fragments
?一些其他评论:对同步消息的答复显示带有虚线,并以领先的结肠显示返回的值(以及原始消息的名称,但我认为无论如何在这里很明显)。
The
break fragment
leaves the immediately enclosing fragment. In your case that would be theopt fragment
. So, it is not correct. Why don’t you use nestedalt fragments
?Some additional remarks: The reply to a synchronous message is shown with a dashed line and the returned value is shown with a leading colon (and the name of the original message, but I think it is obvious here anyway).