Book a Demo

Author Topic: Transformation Templates - Can we do this?  (Read 4767 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Transformation Templates - Can we do this?
« on: October 22, 2018, 02:36:14 pm »
We've been experimenting with the Schema Composer to allow us to generate multiple payload forms from one model.

We've established that the source (base) model (from which the payloads are to be generated) HAS to be a SIMPLE Class Model.  We were hoping to be able to use some of our MDG specific items as the source.  However, it seems that as soon as you stereotype the class, the generated output is changed in a significant way!
(If that should NOT be the case can someone let me know?)
So we appear to have that limitation.  So we then said, OK, let's run a transform to allow us to automatically generate the simple class model from our MDG specific items (initially, just strip the stereotype and see what happens).

It's over a decade since I last used model transform templates and as I recall even then they were a bit problematic.

So, before I waste a LOT of time trying to do the impossible. I thought I'd check here.
  • Can I create a transform to change one class-based model into a similar class-based model?
  • If I just wanted to strip the stereotype from the class to generate the transformed class, what templates should I change?
  • We already have payloads defined as XSDs -which we can reverse engineer.  Can we also use this type of transform to transform from the XSD to a Simple Class (or even our MDG based items)?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transformation Templates - Can we do this?
« Reply #1 on: October 22, 2018, 02:57:18 pm »
Paolo,

I'm not that versed in Transformation templates, but I do have a lot of experience with the Schema Composer.

The way a lot of my clients use it is to first generate a subset model using my add-in EA Message Composer and then generate whatever they need (usually XSD) from that subset model.

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using you own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Transformation Templates - Can we do this?
« Reply #2 on: October 22, 2018, 03:17:30 pm »
Paolo,

I'm not that versed in Transformation templates, but I do have a lot of experience with the Schema Composer.

The way a lot of my clients use it is to first generate a subset model using my add-in EA Message Composer and then generate whatever they need (usually XSD) from that subset model.

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using you own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert
Thanks, Geert,

I was hoping to avoid a lot of that complication.  It's not clear to me why the base class has to be an unstereotyped Class.  I NOTE that when I open the transform templates, EA IGNORES the stereotype and just says our MDG items are Classes.

The Message Composer seems very comprehensive and flexible, but we're not quite ready for that.  I was hoping for a simpler approach since, as Maxwell Smart would say: "We're that close!"

Still, the Message Composer is something to keep in our "back pocket".

Is anyone able to assist with the Transform Templates?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Transformation Templates - Can we do this?
« Reply #3 on: October 22, 2018, 05:52:28 pm »
I once used transformation (in similar hopes like you). However, I was not convinced. The transformation used obscure links in t_xref which are not accessible. When re-transforming it does not really synch so you have to create a new transformation. In the end I dropped it and scripted it to my needs.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Transformation Templates - Can we do this?
« Reply #4 on: October 22, 2018, 06:00:00 pm »
[SNIP]

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using your own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert
Hi again Geert,
I just wanted to clarify your usage above with what I saw on the website for EA Message Composer.

As I understand it, the Message Composer is used to create the subset model and then the Schema Composer is used to generate the payloads.  When you mention "standard XSD generation tool" do you mean marking the [X] XML Schema (XSD) checkbox in the Schema Export dialog of the Schema Composer? If that's not the case, what function does the Schema Composer perform?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Transformation Templates - Can we do this?
« Reply #5 on: October 22, 2018, 06:08:51 pm »
I once used transformation (in similar hopes like you). However, I was not convinced. The transformation used obscure links in t_xref which are not accessible. When re-transforming it does not really synch so you have to create a new transformation. In the end, I dropped it and scripted it to my needs.

q.
Hi q,

I've been "poking, prodding, stretching and twisting" the Schema Composer and the Transformations - trying quickly to find the limits of the "Envelope".  I'm rapidly coming to the same conclusion.  Things appear to be much more fragile than I had hoped after a decade of usage (presumably by other users).  Some of the "issues" I'm finding, I suspect, won't be amenable to a quick fix.

I'll await any input from Schema Composer and Transformation Gurus, but if there's no significant breakthrough overnight, I'll take the route you propose.  That way we can control things better and have a more robust mechanism.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transformation Templates - Can we do this?
« Reply #6 on: October 23, 2018, 02:14:03 am »
[SNIP]

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using your own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert
Hi again Geert,
I just wanted to clarify your usage above with what I saw on the website for EA Message Composer.

As I understand it, the Message Composer is used to create the subset model and then the Schema Composer is used to generate the payloads.  When you mention "standard XSD generation tool" do you mean marking the [X] XML Schema (XSD) checkbox in the Schema Export dialog of the Schema Composer? If that's not the case, what function does the Schema Composer perform?

Paolo
Hi Paolo,

No we use the Schema Composer only to be able to cherry-pick the message content from the general model.
The EA Message Composer is is a Schema Composer add-in that reads the profile and creates the subset model (fully traceable to the main model)

Some clients use this tool on model with an XML Schema profile applied. They use the the standard XSD generation Ribbon =>  Code | Schema | XSD |  Export and XML Schema (XSD) File to generate the code.

Other clients use this on their logical model and have their own tool (one of them written by me) to generate XSD's from the logical model.

I don't think the Schema Composer as such is very useful for generating XSD's directly as it offers no options at all for style etc.., but the cherry picking part is very good.
The standard XSD generation feature is much better (has a lot more options), but you need to start from a physical XSD model to be able to use that.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Transformation Templates - Can we do this?
« Reply #7 on: October 23, 2018, 06:25:02 am »
... So, before I waste a LOT of time trying to do the impossible. I thought I'd check here.
  • Can I create a transform to change one class-based model into a similar class-based model?
  • If I just wanted to strip the stereotype from the class to generate the transformed class, what templates should I change?
  • We already have payloads defined as XSDs -which we can reverse engineer.  Can we also use this type of transform to transform from the XSD to a Simple Class (or even our MDG based items)?
Paolo
To answer those questions;
  • Yes
  • When you create a new transformation you'll get a default transform. Modify the Class part
  • Yes. Somewhere on Sparx Site someone did transforms to go the other way from PSM->PIM->CIM. So if you can find it that might be useful
For details on transformation look at these;
https://sparxsystems.com/resources/mda/
https://sparxsystems.com/resources/user-guides/14.0/model-domains/model-transformation.pdf
« Last Edit: October 23, 2018, 06:27:18 am by Sunshine »
Happy to help
:)