多实例UML时序图(sequence-diagram)互相关联

本文介绍了如何在UML序列图中使用超链接增强交互性,通过在`SERVER_CONTROL`元素上添加超链接,实现从主流程图跳转到详细流程图的功能。这一技巧在文档和流程说明中提供了更好的可读性和导航性。

1. 语法: ref : https://plantuml.com/zh/sequence-diagram
2. example :
 

actor        USER1
participant  APP1
database     SERVER
participant  APP2
actor        USER2

USER1 -> APP1 : input Hi
APP1-> SERVER : send Hi
SERVER-> APP2 : transmit Hi
APP2 -> USER2 : Notify to user 
USER2 -> APP2 : input Hi
APP2-> SERVER : transmit Hi
SERVER-> APP1 : send Hi
APP1 -> USER1 : Notify to user

3. 多个UML关联,跳转

3.1.加入 ref , 如

actor        USER1
participant  APP1
database     SERVER
participant  APP2
actor        USER2

USER1 -> APP1 : input Hi
APP1-> SERVER : send Hi
SERVER-> APP2 : transmit Hi
ref over SERVER
<color blue><size:18>__Server Control__</size></color>
end ref
APP2 -> USER2 : Notify to user 
USER2 -> APP2 : input Hi
APP2-> SERVER : transmit Hi
SERVER-> APP1 : send Hi
APP1 -> USER1 : Notify to user

3.2. Submit -> View as SVG -> 右键 -> 查看网页源码 
源码如下:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="476px" preserveAspectRatio="none" style="width:444px;height:476px;" version="1.1" viewBox="0 0 444 476" width="444px" zoomAndPan="magnify"><defs><filter height="300%" id="fvehvu1izofvg" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="31" x2="31" y1="88.2969" y2="392.4453"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="141.5" x2="141.5" y1="88.2969" y2="392.4453"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="212.5" x2="212.5" y1="88.2969" y2="392.4453"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="307" x2="307" y1="88.2969" y2="392.4453"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="417.5" x2="417.5" y1="88.2969" y2="392.4453"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="46" x="5" y="84.9951">USER1</text><ellipse cx="31" cy="15" fill="#FEFECE" filter="url(#fvehvu1izofvg)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;"/><path d="M31,23 L31,50 M18,31 L44,31 M31,50 L18,65 M31,50 L44,65 " fill="none" filter="url(#fvehvu1izofvg)" style="stroke:#A80036;stroke-width:2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="46" x="5" y="404.4404">USER1</text><ellipse cx="31" cy="417.7422" fill="#FEFECE" filter="url(#fvehvu1izofvg)" rx="8" ry="8" style="stroke:#A80036;stroke-width:2.0;"/><path d="M31,425.7422 L31,452.7422 M18,433.7422 L44,433.7422 M31,452.7422 L18,467.7422 M31,452.7422 L44,467.7422 " fill="none" filter="url(#fvehvu1izofvg)" style="stroke:#A80036;stroke-width:2.0;"/><rect fill="#FEFECE" filter="url(#fvehvu1izofvg)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="51" x="114.5" y="53"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="37" x="121.5" y="72.9951">APP1</text><rect fill="#FEFECE" filter="url(#fvehvu1izofvg)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="51" x="114.5" y="391.4453"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="37" x="121.5" y="411.4404">APP1</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="57" x="181.5" y="84.9951">SERVER</text><path d="M195,36 C195,26 213,26 213,26 C213,26 231,26 231,36 L231,62 C231,72 213,72 213,72 C213,72 195,72 195,62 L195,36 " fill="#FEFECE" filter="url(#fvehvu1izofvg)" style="s
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值