8000 When connecting attributes between object graphs, the connection error · Issue #1397 · plantuml/plantuml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When connecting attributes between object graphs, the connection error #1397

Closed
ghost opened this issue Apr 24, 2023 · 3 comments
Closed

When connecting attributes between object graphs, the connection error #1397

ghost opened this issue Apr 24, 2023 · 3 comments
Assignees
Labels
bug Something isn't working p:wip Work in progress. Be patient :-)

Comments

@ghost
Copy link
ghost commented Apr 24, 2023

Describe the bug
When connecting attributes between object diagrams, the attribute value contains other attribute name, and the connection will be incorrect.

To Reproduce
The example is as follows

@startuml
object myobj {
    attr1 = "xxxxx attr2 xxxxx"
    attr2 = "value2"
}

myobj2 -> myobj::attr2
@enduml

Expected behavior
I want myobj2 to connect to myobj's attribute attr2, but actually connected to attr1.

Screenshots
image

@The-Lum
Copy link
Collaborator
The-Lum commented Apr 24, 2023

Hi @jukkui and all,

This issue occurs with object, and as well for class...

Issue

Here are minimal issue example:

  • with GraphViz
@startuml
object o {
    attr1 = "attr2"
    attr2 = "value2"
}
class c {
    attr1 = "attr2"
    attr2 = "value2"
}

myobj2 --> o::attr2
myobj2 --> c::attr2
@enduml

  • with Smetana
@startuml
!pragma layout smetana
object o {
    attr1 = "attr2"
    attr2 = "value2"
}
class c {
    attr1 = "attr2"
    attr2 = "value2"
}

myobj2 --> o::attr2
myobj2 --> c::attr2
@enduml

Workaround

Here is a possible workaround using Unicode, as:

@startuml
object myobj {
    attr1 = "xxxxx attr<U+0032> xxxxx"
    attr2 = "value2"
}

myobj2 -> myobj::attr2
@enduml

Regards,
Th.

@The-Lum
Copy link
Collaborator
The-Lum commented Apr 24, 2023

Hi @arnaudroques and PlantUML team,

Here are some similar tests.

Note: OK

@startuml
class c0
class c1 {
    attr1 = "attr2"
    attr2 = "value2"
}

note right of c1::attr2
 note about attr2
end note

@enduml

Connecting attributes: ~KO (this defect #1397)

@startuml
class c0
class c1 {
    attr1 = "attr2"
    attr2 = "value2"
}

c0 -> c1::attr2
@enduml

Note + Connecting attributes: java.lang.IllegalStateException

@startuml
class c0
class c1 {
    attr1 = "attr2"
    attr2 = "value2"
}

c0 -> c1::attr2

note right of c1::attr2
 note about attr2
end note

@enduml
An error has occured : java.lang.IllegalStateException
PlantUML (1.2023.6beta5) cannot parse result from dot/GraphViz.
GraphViz version used : version 2.38.0 (20140413.2041)
java.lang.IllegalStateException
net.sourceforge.plantuml.svek.SvekLine.getExtremity(SvekLine.java:517)
net.sourceforge.plantuml.svek.SvekLine.solveLine(SvekLine.java:609)
net.sourceforge.plantuml.svek.DotStringFactory.solve(DotStringFactory.java:451)
net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(GeneralImageBuilder.java:468)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:105)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:70)
net.atmp.CucaDiagram.exportDiagramInternal(CucaDiagram.java:435)
net.sourceforge.plantuml.classdiagram.ClassDiagram.exportDiagramInternal(ClassDiagram.java:84)
net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:142)
net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:198)

In order to help you for debugging...
Regards,
Th.

@arnaudroques arnaudroques self-assigned this Apr 24, 2023
@arnaudroques arnaudroques added bug Something isn't working p:wip Work in progress. Be patient :-) and removed triage labels Apr 24, 2023
@The-Lum
Copy link
Collaborator
The-Lum commented Jun 9, 2024

Hi all, and @arnaudroques,

With a new test:

  • the note is OK ✔️
  • but the arrow is always KO... ❌
@startuml
class c0 {
a
}
class c1 {
    attr1 = "attr2"
    attr2 = "value2"
}

c0::a -> c1::attr2 : <color:red>arrow to attr2 KO

note right of c1::attr2
 <color:green>note about attr2: OK
end note

@enduml

Regards,
Th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p:wip Work in progress. Be patient :-)
Projects
None yet
Development

No branches or pull requests

2 participants
0