Author Topic: XSD generation  (Read 3756 times)

thomas.kilian

  • Guest
XSD generation
« on: February 29, 2008, 11:50:14 pm »
Hi everyone,
I am about to create my own XSD generation as the build-in is configurable near to nothing >:(

Now I have an unpleasant finding which blocks me in going on. When you create an <<enumeration>> there is a Type field which is preset with string. The diagram element shows the 'string' which means (to my understanding) that 'string' is the general class for the enumeration. Now: where does EA hide this information. There is no Generalization relation to any string class. There is no UML attribute which resembles 'string' and there are no tags. Where does EA hide this???

Any help appreciated.
« Last Edit: February 29, 2008, 11:50:34 pm by thomas.kilian »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: XSD generation
« Reply #1 on: February 29, 2008, 11:57:55 pm »
AFAIK this is a case where you have to think in UML - at the metamodel level - rather than EA. The UML metamodel recognizes a few primitives. These are sort of datatypes that are ubiquitous, from which others may be assembled or defined. Among these are your «string» type.

You can get (a pale shadow of) the idea by reading the EA stuff on metamodel development, though there's not much there.

Suffice it to say that you need to detect this data type in your generator and handle it gracefully. Just make sure that you trap these primitives, so your code does not go searching through the model for them.

The good news is that there are mercifully few of these things, and they are not 'exotic' forms of data. You do not need to write any weird code to handle them.

David
« Last Edit: March 01, 2008, 03:49:17 am by Midnight »
No, you can't have it!

thomas.kilian

  • Guest
Re: XSD generation
« Reply #2 on: March 01, 2008, 01:32:11 am »
Quote
Hi Alex,
Who?

Sorry. That did not help a bit. I need a clue where they hide that value. None of the Class properties contains it. I'm pretty sure they stuffed it somewhere in the database - with no access via GUI or API >:(

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: XSD generation
« Reply #3 on: March 01, 2008, 03:50:00 am »
Sorry about that.

Do you mean you need the value of the string in question?

Or do you mean you need some way to determine whether a given enumeration is of type string (versus int for example)?
« Last Edit: March 01, 2008, 03:51:22 am by Midnight »
No, you can't have it!

thomas.kilian

  • Guest
Re: XSD generation
« Reply #4 on: March 01, 2008, 08:02:02 am »
No. I need to know WHERE they get the information from to put it in italics into the class icon. When I delete it in the XSD dialog and draw a REAL generalization it appears the same (but now I know where it came from).

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: XSD generation
« Reply #5 on: March 02, 2008, 12:25:28 am »
OK, I understand what you're doing.

Check the value of the GenLinks field in t_object. You'll find it there.

David

PS: Sorry about not catching on sooner. Sometimes I add 1+1 and get 4, instead of 3.
No, you can't have it!

thomas.kilian

  • Guest
Re: XSD generation
« Reply #6 on: March 02, 2008, 08:05:37 am »
Thanks Midnight. I never would have guessed that. I tried just the obvious ones. I should have known better :-[

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: XSD generation
« Reply #7 on: March 02, 2008, 08:48:42 am »
But did it work?

Quote
Thanks Midnight. I never would have guessed that. I tried just the obvious ones. I should have known better :-[
I'm not so sure this was evident. I cannot find any hint of this anywhere in the documentation. It was reading though all your posts to this thread that rang a bell somewhere in the dark and empty reaches of my mind. I looked at the data - having created several candidate scenarios - and there it was.

So, now I wish I'd thought of it when you wrote your first post. I could have saved you considerable time and aggravation.

All the best,
David
No, you can't have it!