Include from embedded iuml cases Syntax Error

0 votes
asked Nov 26, 2021 in Bug by boshka (3,220 points)
edited Nov 26, 2021 by boshka

Could you please check why this piece of code fails with the Syntax Error?


@startuml

component "a" {
}
component "b" {
}

a -->> b: deliver\n.. Detailed sequence ..\n{{\n!include delivery_seq.iuml\n}}\n

@enduml


See: http://www.plantuml.com/plantuml/uml/JSr12i8m58JX_Jl5i_lc02vA5nxZWQJDB0BfLDj4a92x6n31vVnyCFEP_P7BbaJMVNli1BCEVj0gxRyito9Unt6QTBbgG8el74Rdz8RiOqBG4yy2hb3dZBKQBv5hAW4__hvtuc8_DBPc59d1qES7

commented Nov 26, 2021 by albert (3,180 points)

Most likely because the file delivery_seq.iuml cannot be found (on the server).

Where should it be / where did you get it from?

commented Nov 26, 2021 by boshka (3,220 points)
edited Nov 26, 2021 by boshka

no, it says "Syntax Error?" and the file can be found on server in my case (i know the path is correct). So, Plantuml does not like the syntax in this case (apparently, "!include" in this "single line" notation after the "\n"). Plantuml team, could you please check it?

Also, I checked the multiline notation and it works (see below). But I do need the single line notation.

So, in short, this example works:


note right

 {{

!include delivery_seq.iuml

 }}

end note

BTW: If I put the wrong file name, then the error is different: "cannot include <file_name>"


But this one - does not:


note right:\n{{\n!include delivery_seq.iuml\n}}\n


While this works OK too:


note right:\n{{\na->b:hello\n}}\n


1 Answer

0 votes
answered Nov 26, 2021 by The-Lu (37,800 points)

Hello B.,

Yes there is an issue near:

a -->> b: deliver\n.. Detailed sequence ..\n{{\n!include delivery_seq.iuml\n}}\n

-> @PlantUML team, an idea ?

A possible workaround is to proceed with procedure, as:

@startuml

!procedure $my_include($f)
!include $f
!end procedure

component "a" {
}
component "b" {
}

a -->> b: deliver\n.. Detailed sequence ..\n{{\n$my_include("delivery_seq.iuml")\n}}\n

@enduml

If that can help,
Regards,
Th.

commented Nov 26, 2021 by boshka (3,220 points)
hi The-Lu,

thank you for the workaround! However, I'd prefer that the issue itself gets fixed too ))
commented Nov 28, 2021 by Martin (6,780 points)

Note that this workaround only works if the include file only contains a single line, as any carriage return in the included file then breaks the single line format of the original comment.  For example if the include file contains "e-->f\ng-->h" then that works fine, but if it includes line#1="e-->f", line#2="g-->h", then you get a syntax error.  It is hard to test includes on the online server, but you can use "!include <archimate/Archimate>":

 

...