Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ea0818

Pages: [1]
1
I need to do a loop in a transform template. For example a for...next or a while loop.

I found the EA documentation for the macros at https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/macros.html
In particular branching, such as if or elseIf, is found at https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/branching_macros.html

But I don't see any macro for repeating a set of instructions. Best I can think of is to write a custom transform template, and then repeatedly call it from the main transform template. One of the parameters would indicate what iteration in the loop is to be processed during this execution.
This would be an ugly solution though, as I would need to repeat the call (from the main template) as many times as needed, such as:
$remark="Perform the ten iterations"
%DoLoopWork(1)%
%DoLoopWork(2)%
%DoLoopWork(3)%
%DoLoopWork(4)%
%DoLoopWork(5)%
%DoLoopWork(6)%
%DoLoopWork(7)%
%DoLoopWork(8)%
%DoLoopWork(9)%
%DoLoopWork(10)%


Anyone have a better idea?

2
I have a Business Domain Model, that has the classes, with their attributes and relationships.

I can use Ribbon - Design - Tools - Transform - Apply Transformation.  This creates or synchronizes database tables in a Database model in the EA project.

I need to make some changes to how EA transforms the classes to the database tables.  I have been able to make several changes in the Transformation scripts for the DDL language, but there are a couple things I do not see how to accomplish.

1)  How do I set a default value for the Owner value in created database tables?  E.g., in the properties for the database table, choose Table Detail tab, and see the Owner field.  I want the default Owner for all tables to be "dbo".

2)  How do I change the Transform template scripts so that, in the generated database table, the PK column will be first, followed by any FK columns, lastly followed by the columns created from the attributes of the source class?  I tried editing the Class script to move the Primary Key code before the line with %list="Attribute" @separator="\n" @indent="  "%, but it had no effect.

Is there somewhere that I can find documentation for all destination-class tags that are supported by EA?  For example, I should be able to find documentation for whatever code I need to include in my Transformation DDL script to set the Owner tag for the destination database table.

Thanks.

Pages: [1]