PlantUML时序图第19行语法错误排查与解决求助
解决PlantUML时序图第19行语法错误问题
你的代码中的语法错误出在group块的闭合方式上。部分旧版本的PlantUML不支持用大括号{}包裹group内容,必须使用end group来完成group块的闭合。
修改后的正确代码:
@startuml participant Employee participant System group "Employee adds leave request" Employee -> System: Log in activate System Employee -> System: Select 'Add Leave Request' Employee -> System: Fill out leave request form Employee -> System: Submit leave request System -> System: Validate leave request alt Leave request is valid System -> System: Update leave request status System --> Employee: Notify successful submission else Leave request is invalid System --> Employee: Notify invalid request end deactivate System end group @enduml
错误原因说明:
你原代码中用{}定义group范围,这是较新版本PlantUML支持的语法,但如果你的环境使用旧版本,就会触发语法错误。将大括号替换为group开头、end group结尾的写法,即可兼容新旧版本的PlantUML。另外,也可以尝试升级PlantUML到最新版本,这样能直接支持原代码中的大括号语法。
内容的提问来源于stack exchange,提问作者Kuldeep Sonara
相关产品推荐
相关产品推荐

