Bug 152019

Summary: XML schema code gen handles aggregation/composition incorrectly
Product: [Applications] umbrello Reporter: Christian Hilberg <hilberg>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: okellogg
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Umbrello XMI file implementing the described classes A, B, and composition

Description Christian Hilberg 2007-11-08 18:51:18 UTC
Version:           1.5.71 (using KDE KDE 3.5.7)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc-4.2.3 gcc (GCC) 4.2.3 20071014 (prerelease) (Debian 4.2.2-3)
OS:                Linux

Symptom: The XML schema code generator mixes up the inclusion direction with aggregations / compositions.

How to reproduce the bug:

Create class A. Create class B. Make an association (aggregation or composition) between A and B such that A holds B.
(Diamond should be at A's side now.)
Set the multiplicity to "1" at both ends and name the roles at both ends (otherwise nothing will happen in the XML schema file.)
(N.B.: The multiplicity at A's side should be "1" here anyway, but you have to explicitly set it to see any result in the schema.)
Now have umbrello generate XML schema code for A and B.

Result: A's ComplexType gets included as a sequence element in B's, which should actually be the other way around.

Test: From the same XMI file, have umbrello generate C++ code. You'll see in the headers that the inclusion is correct
(A contains B).
Comment 1 Christian Hilberg 2007-11-08 18:54:59 UTC
In the bugs.kde.org product list, version 1.5.71 was not listed for umbrello (just 1.5.5)

Greetings,

Christian
Comment 2 Andrew Crouthamel 2018-11-02 04:27:40 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Andrew Crouthamel 2018-11-16 02:43:58 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version?

Thank you for helping us make KDE software even better for everyone!
Comment 4 Justin Zobel 2022-12-07 00:24:01 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 5 Bug Janitor Service 2022-12-22 05:19:09 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Oliver Kellogg 2022-12-30 02:48:01 UTC
Created attachment 154892 [details]
Umbrello XMI file implementing the described classes A, B, and composition

In the attached model (bug152019_XmlSchemaAssoc.xmi), in order to get the association generated I had to set the attribute's visibility (i.e. the association Role B visibility) to "protected" or "public".
When using "private" visibility the association was not generated.
Comment 7 Oliver Kellogg 2022-12-30 02:49:41 UTC
The file A.xsd generated from attachment 154982 [details] contains

  <xs:complexType name="AComplexType">
    <xs:attribute name="new_attribute" type="xs:bug152019_XmlSchemaAssoc::B"/>
  </xs:complexType>

which is as expected.