[英]How to show the flow termination in Sequence Diagram
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
?主要是,我不确定图中的
break
是否正确传达了终止流程的意图:它是否意味着跳出外部opt
或外部alt
?
Any help is much appreciated.任何帮助深表感谢。
The break fragment
leaves the immediately enclosing fragment. break fragment
离开直接封闭的片段。 In your case that would be the opt fragment
.在您的情况下,这将是
opt fragment
。 So, it is not correct.所以,这是不正确的。 Why don't you use nested
alt fragments
?为什么不使用嵌套的
alt 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).一些补充说明:对同步消息的回复以虚线显示,返回值以前导冒号显示(以及原始消息的名称,但我认为无论如何在这里很明显)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.