Instant Generator - how / where to set type mapping?

Hi,

how / where is it possible to set the type mapping used by Instant Generator without changing the configured Programming Language ?

Example:

  1. Configured Programming Language is set to ‘Java’ (or any other language except XML)
  2. Instant Generator is used to generate XML Schema (xsd)

How / where can the type mapping be influenced, e.g. in order to map type ‘Date’ to ‘xs:dateTime’ ?

Thanks + best regards,

Jan Harmsen

Hi Jan Harmsen,

Thank you for your post. We are sorry that we do not support setting type mapping for Instant Generator, but may I know why you would like to do this? Thanks!

Best regards,
Lilian Wong

Hi Lilian,

customizable type mapping for Instant Generator makes sense in the following scenario:

Design and development of a document-centric application in an OO language (like Java, ActionScript etc.) where the document model is being exported as XML Schema using Instant Generator.

VP-UML is used to design not only the document model but also the complete application model. Because of this, VP-UML parameter ‘Programming Language’ is set to the programming language being used.
The document model is getting exported by Instant Generator to XML Schema.
This way the generated XML Schema representing the document model is always up-to-date with the current model in VP-UML and can be used to verify the correctness of the application when using the application’s XML document export.

If there was a way to control type mapping

from OO programming language data types

to XSD data type used by XSD Instant Generator

one would safe time since the XSD data types don’t have to be defined and included into Instant Generator resources scripts by hand.

Currently I use a work-around by editing the .vm scripts by hand, adding xsd types which map the OO data types (created when using Instant Generator) to xsd data types. Since these mappings are not part of the VP-UML document, they are not under version control and I have to work with external files which slows down development.

Hope this short description helps to understand the benefits of editable data type mappings in combination with XSD instant generator.

Best regards,

Jan Harmsen

Hi Jan Harmsen,

Thanks for replying. I’ve forwarded the details to our engineers to study. If I get any news about this issue, I’ll come back to you immediately.

If there is any inquiry, please do not hesitate to have a post.

Best regards,
Lilian Wong

Hi Jan Harmsen,

I would like to clarify the requirement about XSD datatype with you to ensure we have caught your point.

Do you want the generated XML Schema (by Tools > Instant Generator > XML Schema…) will follow the datatype of your programming language?
(please refer to the image below for illustration)

Please let me know if I’m wrong. Looking forward for your reply.

Best regards,
Lilian Wong

follow_lang.png

Hi Lilian,

Thanks for getting back !

No, the generated XML Schema should follow the data type mappings as specified in the data type mapping for language ‘XML Schema’, independent of the currently active programming language.
Instant Generator for XML Schema should have a mapping independent of the programming language being used.

This way it would be possible for example to map a modelling data type ‘MyDate’

Currently this does not seem to be possible. In VP-UML you have the possibility to map a modelling data type to a programming language data type (Menu ‘Configure Programming Language’) but this kind of mapping does not get used when one creates an XML Schema and has e.g. programming language ‘Java’.
Also I noticed that a ‘:’ namespace separator (like in xs:date) gets transformed to xs_date when using Instant Generator for XML Schema and having set programming language to XML.
Is this a bug or is some special escaping required when using ‘:’ to indicate a namespace ?

Thanks + best regards,

Jan

P.S.
sorry for responding late, I did not get a notification that a message had been posted even though I had set this topic to ‘watch’ !
This happened to me before, obviously sometimes the notification service is not reliable :frowning:

Hi Jan,

Thanks for replying and the details. I’ve passed the details to our engineers to investigate the feasibility to support in the future. Once I get any feedback, I’ll notify you immediately.

I have also forwarded the issue of namespace separator (should be xs:date instead of xs_date) to our engineers to follow-up, and will keep you informed for any news about this issue as well.

If there is anything I can help, please feel free to contact me again.

BTW, we will upgrade our forum in the future, sorry for the inconvenience caused.

Best regards,
Lilian Wong

Hi Jan,

Sorry for the delay. We fixed the problem of namespace separator with XML Schema as programming language, please download the patch from the link below:
http://files4.visual-paradigm.com/200809/Patch/sp1_20080901m/VP_Suite_MacOSX_3_3_sp1_20080901m.dmg

If there is any further inquiry, please let me know.

Best regards,
Lilian Wong

Hi Lilian,

this patch indeed fixed the problem with namespace separator ‘:’ :smiley:

However it is still not possible when modelling for a programming language like Java or ActionScript to influence the type mapping for Instant Generator XML Schema Export independently of the chosen programming language (which was the original subject of this topic).

Any news on this subject ?

Thanks + best regards,

Jan Harmsen

Hi Jan,

Thanks for replying. Yes, the patch fixes the namespace separator problem only. Our engineers are still studying the issue of XML Schema issue, if there is any news, I will definitely come back to you immediately.

Best regards,
Lilian Wong