简体   繁体   中英

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 ?

Any help is much appreciated.

在此处输入图像描述

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM