Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Angst on September 20, 2010, 02:21:04 pm

Title: class creation date, and class modification date
Post by: Angst on September 20, 2010, 02:21:04 pm
hi,

I am working on Model Transformation, and Code Geneation. I don't know how can I genereate a class with header like below

/****************************************************
 *  %fileName%                                        
 *  Created on: %class creation date in PIM (not PSM)%                      
 *  Last Modified on: %class modification date in PIM (not PSM)%                      
 *  Implementation of the %elemType% %className%      
%if classAuthor != ""%
 *  Original author: %classAuthor%                    
%endIf%
 ****************************************************/

EA version: 7.5

Any help will be very appreciate

Regards,
Hung Tran
Title: Re: class creation date, and class modification da
Post by: Eve on September 20, 2010, 04:21:51 pm
I would generate the creation and modification dates from the PIM class into a tagged value on the PSM class, then use those tagged values.
Title: Re: class creation date, and class modification da
Post by: Angst on September 21, 2010, 01:21:23 pm
I see what you mean, but i cannot find variables which represent for class creation date, and class modication date in Model Transformation.

What are they?
Title: Re: class creation date, and class modification da
Post by: Eve on September 21, 2010, 01:50:32 pm
Tag { name="created"  value=%qt%%classCreated%%qt%  }
Tag { name="modified" value=%qt%%classModified%%qt% }
Title: Re: class creation date, and class modification da
Post by: Angst on September 21, 2010, 07:27:48 pm
I have tried them, but they are not working. classCreated, and classModified are also not highlighted by the tool.

At Class template,

%elemType%
{
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT("language")%
  Tag{name="created" value=%qt%%classCreated%%qt%  }
  Tag{name="modified" value=%qt%%classModified%%qt% }
  language="C#"
  ....
}

Here is output

Class
{
  XRef{namespace="C#" name="Class" source="{349EF7BF-F0D2-4808-A307-80F6ADDD16EA}"}
  complexity="1"
  status="Implemented"
  concurrency=""
  stereotype="interface"
  visibility=""
  persistence="Transient"
  arguments=""
  phase="1.0"
  cardinality=""
  multiplicity=""
  notes=""
  alias=""
  author="Hung Tran"
  name="Button"
  scope="Public"
  version="1.0"
  Tag{name="created" value=""  }
  Tag{name="modified" value="" }
  language="C#"
}

it seems it does not work in EA 7.5, isn't it? :'(