Book a Demo

Author Topic: setting abstract on class transform  (Read 2439 times)

pmcevoy

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
setting abstract on class transform
« on: February 01, 2006, 03:15:51 am »
Hi again,
I have a PIM, which consists of a set of interface definitions for some datatypes.   I have written an XSD transformation template (based on the existing XSD transform) which takes these interface datatypes and creates class elements from the interface elements.

Now, I realize that the source element in the PIM is an interface, and it's element defintion is to marked as abstract (this appears to be the default when you drag an Interface element on to a diagram, and in a way makes sence).

In my class transformation template (which is a slight modification of the XSD transform - I simply added:

Code: [Select]

%if elemType != "Class" and elemType != "Interface"%
%endTemplate%


to the existing XSD template, so that it would parse my interface definitions.

My template then goes on to:

Code: [Select]

Class
{
   %TRANSFORM_REFERENCE("XSDClass")%
 %TRANSFORM_CURRENT("name","stereotype","abstract")%

...

abstract="0"
...
}


I have checked the debug intermediary file, and abstract="0" is being honoured in the intermediary language.  HOWEVER, in my PSM generated diagram, all the new classes are _still_ being marked as abstract - in fact, it does not matter what I set "abstract" to, they still come out as abstract.

This is an issue for me in the XSD PSM, as the generated schema files are marking all the complexTypes as schema abstract, when this is not what I want.

Is this a bug?

Pete

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: setting abstract on class transform
« Reply #1 on: February 01, 2006, 12:49:26 pm »
This is happening because the value that you set to abstract is ignored.  Just the the presence of abstract is setting the class as abstract.  You'll need to only generate abstract if you're wanting to generate an abstract class.

As for if it's a bug.  I think all boolean properties work this way in the transformation.