如何以序列图显示流程终止

发布于 2025-02-02 01:38:07 字数 624 浏览 3 评论 0原文

基本上,我想在序列图中描述以下逻辑:

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.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鱼忆七猫命九 2025-02-09 01:38:07

断开片段离开了立即封闭的片段。在您的情况下,这将是选择片段。因此,这是不正确的。您为什么不使用嵌套alt Fragments

一些其他评论:对同步消息的答复显示带有虚线,并以领先的结肠显示返回的值(以及原始消息的名称,但我认为无论如何在这里很明显)。

The break fragment leaves the immediately enclosing fragment. In your case that would be the opt fragment. So, it is not correct. Why don’t you use nested 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文