Subject: | aggregation direction problem |
Date: | Thu, 20 Mar 2014 17:30:33 +0100 |
To: | bug-Parse-Dia-SQL [...] rt.cpan.org |
From: | Mathieu Servillat <mathieu.servillat [...] obspm.fr> |
Hi,
I am using parsediasql 0.27 installed with the cpan command on the
following system:
$ uname -a
Linux 3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC 2014 x86_64
x86_64 x86_64 GNU/Linux
I used DIA 0.97.2 to create a UML class diagram:
$ dia -v
Dia version 0.97.2, compiled 01:13:06 Oct 14 2013
I followed the documentation for parsediasql on this webpage:
http://tedia2sql.tigris.org/usingtedia2sql.html
Using the --uml option, I found that aggregations were not treated as
explained in the documentation, unless I change the direction (B-->A).
Looking at the SQL.pm file at line 1265, I could change the code and get it
to work properly :
- } elsif ( $self->{uml} && $nodeAttrName eq 'assoc_type' &&
$assocDirection == 2 ) {
+ } elsif ( $self->{uml} && $nodeAttrName eq 'assoc_type' &&
$assocDirection == 1 ) {
Here are the following lines of code:
$leftEnd{aggregate} =
$self->{utils}->get_num_from_node($currentNode);
} elsif ( $self->{uml} && $nodeAttrName eq 'assoc_type' ) {
$rightEnd{aggregate} =
$self->{utils}->get_num_from_node($currentNode);
So it seems that the $assocDirection has to be set to 1, and not 2, to get
the right and left ends correct.
This is somewhat related to bug #66031 resolved few months ago:
https://rt.cpan.org/Public/Bug/Display.html?id=66031
I hope this helps,
Cheers,
Mathieu
--
Dr. Mathieu Servillat
Laboratoire Univers et Théories, Bât 18, Bur. 269
Observatoire de Paris-Meudon
5 place Jules Janssen
92190 Meudon, France
Tél. +33 1 45 07 74 48
!!! PLEASE NOTE MY NEW EMAIL ADDRESS !!!
mathieu.servillat@obspm.fr
--