Book a Demo

Author Topic: TRANSFORM_TAGS not working the way I expected/want  (Read 2810 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
TRANSFORM_TAGS not working the way I expected/want
« on: July 25, 2014, 07:06:52 am »
I've created a new transformation type which performs a transformation on a set of classes.

Included in the "Class" template is the line:

%TRANSFORM_TAGS()%

Which is intended to copy ALL tags from source to target.

Unfortunately this is NOT the case.
What actually happens is only those tags whose values are not null are copied.

The problem with this is of course that I require the tagged values in the target elements so that the users can set the values THERE if required.

So, what I need to know is:

1. Is there any way to override this behaviour?, or
2. Is there any way to detect if a tagged value is null so I can include a literal string to replace it?

Obviously option 1 is preferable because option 2 would require me to know in advance the possible set of tag values and hence the type of elements that can possibly be transformed.

Thanks in advance

Jays  :)

Max H

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
    • SafeCode Consulting
Re: TRANSFORM_TAGS not working the way I expected/
« Reply #1 on: August 09, 2014, 02:31:23 am »
I have noticed this behavior too. I don't know the answer, but maybe these ideas will help...

1.) Maybe if you were to define a new stereotype containing those tags, they would carry through on the transform.

2.) You could just set the tag to "Undefined" or "TBD" in the PIM and deal with it at generation time; treat that the same as an empty value if it isn't redefined.  If the tag is needed in every case, you could even use the transform template to add the tag when it is missing from the PIM.

3) You might be able to combine the two ideas and selectively apply #2 based on a stereotype.