Book a Demo

Author Topic: import / export of model transform template  (Read 2984 times)

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
import / export of model transform template
« on: August 15, 2005, 09:58:17 pm »
I am trying to develop a new model transform template in my sandpit model, export the thing and then re-import it into the "real" model.

Now, the Java Transform template seemed a good starting point... first question:

1) how can I designate a new transform to be based on an existing one?

Well, I thought, all else failing, let's do the crude thing and export it (Reference Data export), change its name, and re-import it...  

Well, I had a look at the exported XML file. Hardly anything in it?! Certainly, I don't seem to see any of the "sub-templates".  Further, it seems that GUIDs and such are exported as well... In short, that doesn't quite look like the way to go...

So, question

2): what is the procedure to export a "complete" model transform template (including all sub-templates etc.)?

Any ideas? Help? Pointers to doco?

« Last Edit: August 15, 2005, 09:59:26 pm by olafk »

olafk

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: import / export of model transform template
« Reply #1 on: August 17, 2005, 12:15:46 am »
Well, one advantage of not getting an immediate reply is that one has to solve the problem on his/her own, right? Or, rather, think and do before post?

Now, for the public interest, here it is... suggestions and improvements welcome...

cheers,
olaf.




  • Only changed / modified templates will be exported. The assumption here seems to be that _every_ EA model contains the same default set of templates - and thus only the modified ones need exporting.
  • When exporting such (altered) templates, their ID is carried along; that is, the altered template is not so much identified by the "Transformation Type" (e.g. Java) and its name within that transformation type, but by its ID (or both - don't know).
  • The previous point implies that simply exporting (say) some Java transformation, changing its name to (say) MyJavaTransform and re-importing will not work --- as the keys will be duplicates. (The importer reports duplicate key errors or some such).

So, if we want to prepare a model transformation that is to be imported elsewhere, the following procedure is the easiest to follow:

  • In the sand-pit model, create a new transformation type; this will give you a half-dozen or so empty default templates;
  • These empty templates now need to be populated with whatever you want them to do. If that is similar to (say) Java, well, cut and paste from the Java transformation templates (all within EA); yes, tedious, I know...
  • Test proper functioning;
  • Export the Transformation Type to file - using {{Tools->Export Reference Data}}; the newly-created transformation type will appear in the export dialog as "MyJavaTransform_Transform_Template";
  • In the "target" model, import from file using {{Tool->Import Reference Data}} --- and hope like hell that the IDs haven't been taken up otherwise and are unique (although in the worst case, you could always manually set up the transformation type and cut and paste from the xml file ;-)
  • Once the transformation type has been loaded into the target model successfully, repeated exporting and importing (for changes, improvements and such) is no trouble at all. In fact, this can be done bi-directionally.
  • You might want to consider importing / maintaining such transformation types as part of "base" models such that any newly-created models (based on such a "base" model) will automatically pick them up during their creation.

Yes, I know, quite tedious... but, remember, after the initial export/import cycle the pain eases.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: import / export of model transform template
« Reply #2 on: August 17, 2005, 04:02:00 pm »
My suggestion to copy some base templates, would be the following.

  • Click the save button for each of the templates in the original transformation.
  • Export the templates.
  • Delete the saved copy of each of the templates.
  • Change the name in the exported templates to the new transformation name.
  • Re-import the templates. (No worries about duplicate IDs unless you forgot to delete one or more)
As an additional note.  I wouldn't worry about the "hope like hell".  There are 32 hexadecimal digits in each key.  So, assuming a reasonable generator made them, and that there isn't some other reason why there are the same, the chance of two duplicate keys happening is extremely low. (16-32 or 2.9x10-39)

Simon

thomaskilian

  • Guest
Re: import / export of model transform template
« Reply #3 on: October 24, 2005, 03:21:13 am »
Hi Simon,
your method works indeed. However, it's still tedious and I wonder why there are no Duplicate, Delete and Rename buttons for the existing language templates. It took me a while to find out that deleting a language template is managed be deleting all of the  template pieces.