Book a Demo

Author Topic: Transform  (Read 12857 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Transform
« on: August 28, 2019, 05:33:40 am »
Elsewhere in the forum I posted the following:
Quote
I would love if Sparx EA could do the below, if the Paste\Drop As had an extra option to create a link/shortcut to an element in another package, it is almost a form of pseudo-instantiation.

Model
---->Information System 1 Model
------->Class Model
------------->Diagram 1
------------->Class 1
---->Information System 2 Model
------->Class Model
------------->Diagram 2
------------->Link to Class 1 (from Information System 1 Model)
------------->Class 2
We have been looking at ways of doing this in an environment with multiple architects working collaboratively and have rule out source control.

Could a Transform we used to create a copy, with the same stereotype or with another,  of a selection of elements in a package into another package? If so what are the pros and cons?

I am also aware that Sparx EA
  • creates a link between the element being transformed and the element resulting from the transformation , and that
  • when re-synching a set of already transformed elements Sparx EA just updates any transformed elements that have changed

Is this link bidirectional? Can it be surfaced?
« Last Edit: September 11, 2019, 05:01:11 am by Modesto Vega »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Transform
« Reply #1 on: August 28, 2019, 07:41:32 am »
In the beginning I was quite fond of these transformations. Looked like the way to go from abstract business models to concrete class models and even database models. But just those links seemed to render useless and confusing. I soon gave up with that approach and created a real copy of a business model to create class model. Thereby either single element or just whole packages were back-traced manually. Also, since the business model needed changes over the time, there needed to be mechanisms to track these changes so the class model could be adapted. That never was an easy straight forward thing. But you needed to take into account that those changes are connected with business rules (everyone has to say something: marketing, finance, development, etc.).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transform
« Reply #2 on: August 28, 2019, 01:31:23 pm »
If you are looking for a tool to create a copy of a subset of classes, attributes and associations, you might want to check out the EA Message Composer addin.
The subset model created is fully traceable on class, attribute and associations level.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Transform
« Reply #3 on: September 11, 2019, 05:12:52 am »
If you are looking for a tool to create a copy of a subset of classes, attributes and associations, you might want to check out the EA Message Composer addin.
The subset model created is fully traceable on class, attribute and associations level.

Geert
The EA Message Composer may do the trick but I have a number of questions:
  • Why does it use a Transform?
  • Does it have to use ECDM Message Composer Transform? Can it use any other transform? If not, can the ECDM Message Composer Transform be customised?
  • After creating a copy, if something changes - e.g., description/notes, status, phase, complexity, element level tagged values - in the common/canonical model can the copy be refreshed to incorporate the changes?
  • If somebody introduces a change to a copied element, including new attributes, can the canonical model be updated?

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Transform
« Reply #4 on: September 11, 2019, 05:24:01 am »
Just 2 other questions that may not be related to the EA Message Composer discussion:
  • Is it possible to write a conditional transform, one that only transforms classes with attributes and does not transform classes without attributes?
  • Can a transform be written that creates a copy of all the diagrams containing the classes being transformed and replacing them with the transformed classes?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transform
« Reply #5 on: September 11, 2019, 04:03:32 pm »
If you are looking for a tool to create a copy of a subset of classes, attributes and associations, you might want to check out the EA Message Composer addin.
The subset model created is fully traceable on class, attribute and associations level.

Geert
The EA Message Composer may do the trick but I have a number of questions:
  • Why does it use a Transform?
It doesn't matter if you choose Schema or Model Transform. The result is exactly the same for both choices
Quote
  • Does it have to use ECDM Message Composer Transform? Can it use any other transform? If not, can the ECDM Message Composer Transform be customised?
That is the name of the generation for the add-in. If you choose another, then another add-in, or one of the standard transforms is executed. There are quite a number of settings that change certain aspects of the transformation, but there is not something like a transformation template
Quote
  • After creating a copy, if something changes - e.g., description/notes, status, phase, complexity, element level tagged values - in the common/canonical model can the copy be refreshed to incorporate the changes?
If you generate the subset again it will incorporate the changes made in the canonical model. There are a number of settings that control the details of this behavior.
Quote
  • If somebody introduces a change to a copied element, including new attributes, can the canonical model be updated?
No, it's a one way street. But you can set a few exceptions in case you wanted some subset changes not be overwritten the next generation
Just 2 other questions that may not be related to the EA Message Composer discussion:
  • Is it possible to write a conditional transform, one that only transforms classes with attributes and does not transform classes without attributes?
Yes, you choose which classes and attributes should be included in the subset in the Schema Composer tool.
Quote
  • Can a transform be written that creates a copy of all the diagrams containing the classes being transformed and replacing them with the transformed classes?
That behavior is not build into the add-in, but I did write a script for a client that does this type of post-processing. It completely replicates the structure of the canonical model, including packages and diagrams.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Transform
« Reply #6 on: September 11, 2019, 06:20:25 pm »
It doesn't matter if you choose Schema or Model Transform. The result is exactly the same for both choices
Geert you wrote the add-in, so there must be an advantage to using it. In addition of allowing to choose which attributes to copy/transform (which is already an advantage), what else does it offer?

Just 2 other questions that may not be related to the EA Message Composer discussion:
  • Is it possible to write a conditional transform, one that only transforms classes with attributes and does not transform classes without attributes?
Yes, you choose which classes and attributes should be included in the subset in the Schema Composer tool.
I don't think I explained this well enough. I am after a transform that works as follows (please don't ask why). For each sub-package in the package being transformed
  • Create a package with the same name in the target package
  • Iterate through each element (class) in the source package (the package being transformed)
  • If the element (class) has any attributes a) create an exact copy in the target package with a different stereotype, and b) create a trace between both elements
  • If the element (class) has no attributes, do not transform it


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transform
« Reply #7 on: September 11, 2019, 06:45:26 pm »
The add-in is a Schema composer add-in.
The main purpose is to cherry pick part of a class model using he Schema Composer, and then do something with it.
That something could be
- Generate an XSD schema (build in)
- Generate a JSON schema (build in)
- Generate a subset model (what my add-in does)

Clients use this add-in for mainly two purposes:

- create a "message" model from a canonical model (some use the XSD UML profile so they can generate the XSD's directly, other have their own XSD/JSON/... transformation tool to generate specifiations from these message models)
- create a "subset data model" from a canonical model.

But in any way, it all start with selecting which classes and attributes need to go in the subset model, using the Schema Composer.
Now in some cases I've written script to actually create a schema composer profile based on certain criteria (e.g. copy of a whole data model)

Main advantages of my Add-in
- create a fully traced subset model
- supports all the redefines/overwrites supported by the Message Composer
- depending on the settings can do things like collapse inheritance, use a common set of classes or datatypes,
- supports all kinds of mechanisms to allow for differences in the subset model to be marked as exception so they are kept when re-generating

I think your use case could be done with the Message Composer add-in, but that is not necessarily the only tool.
For another client I did something similar to what you are asking.
The script I wrote for them does something like this:

- Create a copy of a package branch
- In the created copy
  - change stereotypes according to some set rules
  - do some stuff with names according to the the set rules
  - add traceability for each class, attribute and association
  - delete classes, attributes, and associations that fit certain criteria

Because there was not much cherry picking to do (and all the cherry picking could be automated according to some rules) we decided not to the the Schema Composer, but instead start with a complete copy of the package tree.
Major difference with the Message Composer approach is that this script is not repeatable. It always creates a full transformed copy, whereas the Message Composer can update an existing subset model.

Geert