Author Topic: XSD Export - Truncating similarly named packages  (Read 5028 times)

damo1978

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
XSD Export - Truncating similarly named packages
« on: October 02, 2015, 04:43:38 am »
I've had this issue for a long time so I thought it's about time to raise it.

I have quite a large class model which is a platform-independent model used as a canonic model, which I then export to an XSD for implementation into our middleware platform.  The model has many packages, general only with one sub-package per main domain area.

Example of package structure:

ConsumerApplication
Party
PartyRelationship
    PartyRelationship_BU
CRM
    CRM_BU
Document
DocumentTemplate
FinancialAccount
    FinancialAccount_BU
FinancialTransaction
    FinancialTransaction_BU
Order
OrderEvent
SuccessError

The sub-packages are simply specialised area per business unit, and I don't think particularly important.

When one package references another, say a PartyRelationship object is used in the Party model, the following happens in the Party model XSD export

<include schemaLocation="../CRM/CRM.xsd">
<include schemaLocation="../SuccessError/SuccessError.xsd">
<include schemaLocation="elationship/PartyRelationship.xsd">

When it should be:
<include schemaLocation="../CRM/CRM.xsd">
<include schemaLocation="../SuccessError/SuccessError.xsd">
<include schemaLocation="../PartyRelationship/PartyRelationship.xsd">

Similarly, if Order references OrderEvent:
<include schemaLocation="vent/OrderEvent.xsd">
Instead of:
<include schemaLocation="../OrderEvent/OrderEvent.xsd">

This only seems to happen where there are packages that are similarly named, and have a reference to each other.  It doesn't happen to the Financial* starting ones, but that may be because there isn't a stand alone package, e.g. Party and PartyRelationship, where Party is stand alone.

I've tried doing a transform to an XSD stereotyped model first before then exporting this.  And direct to XSD.

I believe it's some sort of but with the XSD export script but I cannot be sure.  If anybody has any ideas it would be very much appreciated.

Thanks in advance.

Rodrigo Nascimento

  • EA User
  • **
  • Posts: 33
  • Karma: +3/-0
    • View Profile
Re: XSD Export - Truncating similarly named packag
« Reply #1 on: October 07, 2015, 01:13:43 am »
Few questions:

  • What Sparx EA version are you using?
  • Are you specifying the schemaLocation as a tag in your packages? Or are you using the relative-path option in the schema generation?
  • Are experiencing the same problem when you transform to XSD UML Profile?

Regards,
Rod

« Last Edit: October 07, 2015, 01:14:21 am by rodrigocmn »
Please check my blog for more EA related articles!

http://connection.rnascimento.com

damo1978

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: XSD Export - Truncating similarly named packag
« Reply #2 on: December 09, 2015, 08:17:34 am »
Sorry for the delay.  I didn't realise you don't get noticed on post updates.  Just assumed nobody had answered.

This same issue has happened since v10, including 11, and we're now on 12.

I'm not explicitly using schemaLocation; I'm using the relative path.

Yes the same problem occurs when transforming to the XSD UML profile.

I have a feeling it is some bug with the code generation script, but I don't know enough about scripts to figure it out right now, so I've been manually updating the XSD afterwards.

Rodrigo Nascimento

  • EA User
  • **
  • Posts: 33
  • Karma: +3/-0
    • View Profile
Re: XSD Export - Truncating similarly named packag
« Reply #3 on: December 09, 2015, 10:50:54 am »
That is odd...

I have couple suggestions:

  • Check if the MDA Transformation Template script is setting the schemaLocation (just in case).
  • If not, try to populate the schemaLocation and see if you get the same error.

Another option is to use the new Schema Composer (from v12 onwards). I find it more useful for integration purposes as you can create a model subset with right level of granularity for your integration services. You can find few articles about it in my blog:

http://connection.rnascimento.com

Hope it helps.
« Last Edit: December 09, 2015, 10:51:21 am by rodrigocmn »
Please check my blog for more EA related articles!

http://connection.rnascimento.com