1
Automation Interface, Add-Ins and Tools / Loops in transform template?
« on: June 27, 2023, 03:17:01 am »
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(
%
%DoLoopWork(9)%
%DoLoopWork(10)%
Anyone have a better idea?
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(
%%DoLoopWork(9)%
%DoLoopWork(10)%
Anyone have a better idea?