Author Topic: Transform issues  (Read 13605 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1064
  • Karma: +28/-8
    • View Profile
Re: Transform issues
« Reply #30 on: June 26, 2020, 12:51:08 am »
Sorry to resurrect this topic but I got a transform giving me a headache.

I have reverse engineered a physical database using Database Builder and Sparx 15.1.1527. I have a physical to logical transform that I thought worked fine in previous version of Sparx but in this case it does not do 2 things:
  • it does not generate a trace between the physical and logical data entities
  • most importantly, it does not transform/copy any foreign keys.

Where have I gone wrong?

Latest Class transform is
Code: [Select]
$COMMENT="  The class template is used for all elements along with the  "
$COMMENT="  class macros.  This template copies all class information   "
$COMMENT="  including everything that the class contains.               "
$COMMENT="  A %TRANSFORM_REFERENCE()% macro call is required to         "
$COMMENT="  identify the transformed class.                             "
%if elemType != "Class" and elemType != "Interface" and elemType != "Enumeration"%
%endTemplate%

%elemType%
{
%TRANSFORM_REFERENCE("Class")%
stereotype = "Logical Data Entity"
language = "Canonical"

%list="Attribute" @separator="\n" @indent="  "%

$name=%REPLACE(className, "tbl_", "")%
$name=%REPLACE(className, "tbl", "")%
name=%qt%%CONVERT_NAME($name, "Pascal Case", "Ht( )Ht")%%qt%

%list="Connector" @separator="\n"%

Abstraction
{
%TRANSFORM_REFERENCE("SourceDependency",classGUID)%
stereotype="trace"

Source
{
%TRANSFORM_REFERENCE(className,classGUID)%
}
Target
{
GUID=%qt%%classGUID%%qt%
}
}


}

Latest Connector transform is (copied from the Data Modelling to ERD transform, as the previous one is not working)

Code: [Select]
$Comment="Convert the links between Entities to Associations."

%if connectorType=="Association"%
Association
{
%TRANSFORM_CURRENT("name","note","alias","direction", "stereotype")%
%TRANSFORM_REFERENCE("ERDRelationship",connectorGUID)%
stereotype="ERD_Relationship"
 Source
 {
 %TRANSFORM_REFERENCE(connectorDestElemName,connectorDestElemGUID)%
 %TRANSFORM_CURRENT("name", "stereotype","direction")%
 multiplicity=%qt%%connectorDestMultiplicity%%qt%
  }
 Target
 {
 %TRANSFORM_REFERENCE(connectorSourceElemName,connectorSourceElemGUID)%
 %TRANSFORM_CURRENT("name", "stereotype","direction")%
 multiplicity=%qt%%connectorSourceMultiplicity%%qt%
 }
}
%endIf%

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1064
  • Karma: +28/-8
    • View Profile
Re: Transform issues
« Reply #31 on: July 08, 2020, 09:07:13 pm »
I was hoping to have gotten a reply on this already. The Data Modelling to ERD transform does not have this problem and I suspect that there is something in that transformation that should be in the Physical to Logical Transformation. I also suspect that this may have something to do with Sparx v15, since, from memory, I do recall having a similar problem with a similar transformation on Sparx EA v 14.