Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Error generating uml when same file included in two different uml diagram

0 votes

See page : http://plantuml.sourceforge.net/preprocessing.html

The error is visible in the conditions section.

 

When a file contains multiple PlantUML diagrams and said diagrams all include the same PlantUML file (a style definition file) an error occured after the first diagram.

-> File already included ...

asked Apr 28, 2015 in bug by anonymous
Seems to be a regression that appear in build 8022

1 Answer

0 votes
 
Best answer
Ok, thanks for the feedback.

This should be fixed in the last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

If it's ok for you, we will release a new version with this correction.

Thanks again
answered Apr 28, 2015 by plantuml (118,230 points)
Problem solved.

Thank you for your prompitude (? alactrity ? the speed to provide a fix to this problem).
This implementation has been slightly changed in V8026, but it should continue to work.
I recently updated my PlantUML plugin for Eclipse to latest version 8035, and it seems the problem is poping up again.
Could you post here a minimum non-working example ?
The problem should be slightly different this time, because http://plantuml.com/preprocessing.html looks fine this time.
Thanks.
As a short example, just try the following content for _test_.uml file.

@startuml
!include _style_.cfg
!include _style_.cfg
Bob ->> Alice: Hello
@enduml

And the following content for _style_.cfg file.

@startuml
!ifndef _STYLE_CFG_
!define _STYLE_CFG_
hide footbox
!endif
@enduml

When running plantuml from command line, I have the following error.
> Error line 3 in file: /tmp/_test_.uml
> Some diagram description contains errors

With the Eclipse plugin, the error is strangely different.
> @startuml
> hide footbox
> File already included /tmp/_style_.cfg
>  Syntax Error?

Best regards,
Fran├žois.
Thanks for the example.
We have two options here:
- either we ignore the second inclusion (but without any error message)
- or we do include a second time the file

Which behaviour are you expecting ?
I think it is more or less the same for me, even if the real cases are not so trivial as including twice the same file from one file.

Assuming that the current syntax for the inclusions and the defines are close to the C syntax, I would perhaps also follow the same principles for this multiple inclusion problem.
We choose the easiest to implement.
So here is a beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
That beta ignores second inclusion.
You can test it from command line. (Testing from Eclipse is not possible for a beta release)
Is it working for you?
This is working as expected.
Thank you.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...