INDEX
Introduction
Command Line
Cube Model Structure
Reading Guide
First Impression
Iteration Stack
Selection
Replacement
Introduction Recursivity
Repeating Iteration
Stack Locations
Model References
Reference Processing
Parent Processing
Inversion Processing
Logical Expressions
Logical Operators
Qualifier
First and Last
Parent and Child
Hierarchy Navigation
Vertical navigation
Horizontal Navigation
Replacement References
Replacement Functions
Manipulate Text
Property Replacements
Character Escaping
HTML / Percent Encoding
Reusable Text
Text Blocks / Text Labels
External Functions
Perl Expressions
Sequential Processing
Sequential Iterations
Model Enhancement
Wildcard
Enhance Model
Template Functions
BODY
DECL
EVAL
FILE
FOR
FORH
FORV
IF
INCLUDE
LOOP
REPEAT
SEQUENCE
TABS
TEMPLATE
TEXT
VALUE
comment
parameters
replacement
Logical Functions
AND
CHILD
EVAL
FIRST
ID
LAST
LEVEL
NOT
OR
PARENT
ROOT
TAG
parameter=
parentheses
property=

HOME
CUBEGEN MANUAL
Transform a CubeGen Model into Code according to your own Template.
Introduction
CubeGen is essentially a copy with replace function. The input consists of two text files: the model file and the template file. The model file contains the parameters for replacing the labels that have been applied in the template file. The template file contains the source code provided with labels.
The special thing about CubeGen is that the parameters have a hierarchical structure, which you can easily run through recursively.
Command Line
The program can be run from the command line as a executable or as a Perl script.
cubegen.exe <model> <template> <code> <arguments>
perl cubegen.pl <model> <template> <code> <arguments>
- <model>: Imported Cube Model textfile
- <template>: Imported CubeGen Template Textfile
- <code>: Textfile to generate
- <parameters>: Arguments that can be referenced in the template
Cube Model Structure
A Cube model is a hierachical structure of model elements. An element can be a group of other elements. A group starts with a "+" followed by a tag and ends with "-" followed by the tag. In the case of a separate element the two lines can be merged into one line starting with a "=". A model element can have an idenfier specified between brackets.
The structure can best be explained by an example:
+<tagA>[<identA]:<prop0>|<prop1>|...|propN;
=<tagB>[<identB]:<prop0>|<prop1>|...|propN;
+<tagC>[<identC]:<prop0>|<prop1>|...|propN;
=<tagD>[<identD]:<prop0>|<prop1>|..|propN;
-<tagC>:;
-<tagA>:;
Reading Guide
In the first part the functions are explained with examples. The input and output of CubeGen have a background color that match the arrows in the above logo. When the content of a Model or Template is changed, the concernded Code is regenerated by pressing the CubeGen button.
Internet Explorer users have to take the following into account:
- A new line in the Model or Template has to be added with shift-Enter.
- When the code is regenerated the tab characters are presented as a single space.
The second part contains an overview of the template functions and the logical functions.
First Impression
A simple example with a small model is used to give a first impression of the functionality of CubeGen.
Cube Model
=BUSINESS_OBJECT_TYPE[CASE1-BOT-000000100040]:CUSTOMER|EXT|customer_files;
=BUSINESS_OBJECT_TYPE[CASE1-BOT-000000100024]:ORDER|INT|order_directory;
=BUSINESS_OBJECT_TYPE[CASE1-BOT-000000100025]:PRODUCT|INT|product_definitions;
Iteration Stack
The LOOP statement walks through the model elements for the specified type. For each nested LOOP a model element is placed on the stack.
Template
This is a list of the Busines Object Types:[[LOOP,BUSINESS_OBJECT_TYPE]]
- <<BUSINESS_OBJECT_TYPE:U>>[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
This is a list of the Busines Object Types:
- CUSTOMER
- ORDER
- PRODUCT
Selection
The IF, ELSIF, ELSE structure makes a choice between texts based on conditions (logical_expressions).
Template
Explain selection:[[LOOP,BUSINESS_OBJECT_TYPE]][[IF:0=CUSTOMER]]
<<BUSINESS_OBJECT_TYPE>> concerns customers.[[ELSIF:0=ORDER]]
<<BUSINESS_OBJECT_TYPE>> concerns no customers but orders.[[ELSE]]
<<BUSINESS_OBJECT_TYPE>> concerns something else.[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Explain selection:
CUSTOMER concerns customers.
ORDER concerns no customers but orders.
PRODUCT concerns something else.
Replacement
Replace a label with the model value. By default, a label refers to the value of the first property of the model element. A number behind the tag refers to the other properties. For example, "1" refers to the next following property, so the second one.
Template
[[LOOP,BUSINESS_OBJECT_TYPE]]Unchanged: <<BUSINESS_OBJECT_TYPE>>, <<BUSINESS_OBJECT_TYPE2>>
Uppercase: <<BUSINESS_OBJECT_TYPE:U>>, <<BUSINESS_OBJECT_TYPE2:U>>
Lowercase: <<BUSINESS_OBJECT_TYPE:L>>, <<BUSINESS_OBJECT_TYPE2:L>>
Camelcase: <<BUSINESS_OBJECT_TYPE:L>>, <<BUSINESS_OBJECT_TYPE2:C>>

[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Unchanged: CUSTOMER, customer_files
Uppercase: CUSTOMER, CUSTOMER_FILES
Lowercase: customer, customer_files
Camelcase: customer, CustomerFiles

Unchanged: ORDER, order_directory
Uppercase: ORDER, ORDER_DIRECTORY
Lowercase: order, order_directory
Camelcase: order, OrderDirectory

Unchanged: PRODUCT, product_definitions
Uppercase: PRODUCT, PRODUCT_DEFINITIONS
Lowercase: product, product_definitions
Camelcase: product, ProductDefinitions

Introduction Recursivity
A first impression of going through a hierarchy in a recursive way.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE2-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE2-TYP-000000100000]:PRODUCT|PRD|Y;
=TYPE[CASE2-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
+TYPE[CASE2-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
=TYPE[CASE2-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Repeating Iteration
On the location of the REPEAT statement the loop has been repeated for all underlying elements of the same type.
Template
[[LOOP,BUSINESS_OBJECT_TYPE]]Structure of <<BUSINESS_OBJECT_TYPE:C>>:[[LOOP,TYPE]]
- <<TYPE:C>>[[REPEAT:TAB]][[ENDLOOP,TYPE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Structure of Product:
- Product
- ProductPartApplication
- ProductionProces
- ProductionProcesStep
Stack Locations
For each nested LOOP a model element is placed on the stack. By default, reference is made to the last model element placed on the stack. By means of a tag and location, reference can be made to every model element on the stack.
Location "1" refers to the first model element that is placed on the stack for the relevant tag. Location "N" shows the most recent. A calculation can refer to an intermediate model element. For example, location "N-1" refers to the second to last.
Template
[[LOOP,BUSINESS_OBJECT_TYPE]]Structure of <<BUSINESS_OBJECT_TYPE:C>>:[[LOOP,TYPE]]
- <<TYPE:C>> R=<<TYPE(1):C>>[[IF:!ROOT]] P=<<TYPE(N-1):C>> L2=<<TYPE(2):C>>[[ENDIF]][[REPEAT:TAB]][[ENDLOOP,TYPE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Structure of Product:
- Product R=Product
- ProductPartApplication R=Product P=Product L2=ProductPartApplication
- ProductionProces R=Product P=Product L2=ProductionProces
- ProductionProcesStep R=Product P=ProductionProces L2=ProductionProces
Model References
A model element can also have references to other model elements. These model lines start with ">" and have an alias followed by the identifier of the target model element.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE10-BOT-000000100040]:CUSTOMER|EXT|customer_files;
+TYPE[CASE10-TYP-000000100021]:CUSTOMER|CUS|N;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE10-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE10-TYP-000000100020]:ORDER|ORD|N;
+REFERENCE[CASE10-REF-000000100000]:IS_PLACED_BY|N;
>REFERENCE_TYPE:CASE10-TYP-000000100021;
-REFERENCE:;
+TYPE[CASE10-TYP-000000100022]:ORDER_LINE|ORL|Y;
+REFERENCE[CASE10-REF-000000100001]:CONCERNS|Y;
>REFERENCE_TYPE:CASE10-TYP-000000100000;
-REFERENCE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE10-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE10-TYP-000000100000]:PRODUCT|PRD|Y;
=TYPE[CASE10-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
+TYPE[CASE10-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
=TYPE[CASE10-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Reference Processing
The LOOP statement also processes the references as they are model elements.
Template
List of References:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]][[LOOP,REFERENCE]][[LOOP,REFERENCE_TYPE]]
<<TYPE:C>> <<REFERENCE:C>> <<REFERENCE_TYPE:C>>[[ENDLOOP,REFERENCE_TYPE]][[ENDLOOP,REFERENCE]][[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
List of References:
Order IsPlacedBy Customer
OrderLine Concerns Product
Parent Processing
With a "^" in front of the tag, the LOOP statement also processes the parents as they are chiild model elements.
Template
List of References with parent:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]][[LOOP,REFERENCE]][[LOOP,REFERENCE_TYPE]]
<<TYPE:C>> <<REFERENCE:C>> <<REFERENCE_TYPE:C>> (<<REFERENCE_TYPE1:U>>)[[LOOP,^BUSINESS_OBJECT_TYPE]]
- Business Object Type: <<^BUSINESS_OBJECT_TYPE:C>> (<<^BUSINESS_OBJECT_TYPE2:C>>)[[ENDLOOP,^BUSINESS_OBJECT_TYPE]][[ENDLOOP,REFERENCE_TYPE]][[ENDLOOP,REFERENCE]][[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
List of References with parent:
Order IsPlacedBy Customer (CUS)
- Business Object Type: Customer (CustomerFiles)
OrderLine Concerns Product (PRD)
- Business Object Type: Product (ProductDefinitions)
Inversion Processing
With a "*" in front of the tag, the LOOP statement processes the referenes in the inversed direction.
Template
List of referenced types:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]][[LOOP,*REFERENCE]]
<<TYPE:C>> is referenced by [[LOOP,^TYPE]]<<^TYPE:C>>[[ENDLOOP,^TYPE]] with reference <<REFERENCE:C>>[[ENDLOOP,*REFERENCE]][[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
List of referenced types:
Customer is referenced by Order with reference IsPlacedBy
Product is referenced by OrderLine with reference Concerns
Logical Expressions
Logical expressions are used in the LOOP, IF, CHILD and PARENT functions. A logical expression consists of one logical function or one or more logical operators that combine logical functions.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE20-BOT-000000100040]:CUSTOMER|EXT|customer_files;
=TYPE[CASE20-TYP-000000100021]:CUSTOMER|CUS|N;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE20-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE20-TYP-000000100020]:ORDER|ORD|N;
=TYPE[CASE20-TYP-000000100022]:ORDER_LINE|ORL|Y;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE20-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE20-TYP-000000100000]:PRODUCT|PRD|Y;
=TYPE[CASE20-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
+TYPE[CASE20-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
=TYPE[CASE20-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE20-BOT-000000100100]:FACTORY|INT|production_locations;
+TYPE[CASE20-TYP-000000100100]:FACTORY|FCT|N;
=TYPE[CASE20-TYP-000000100101]:FACTORY_HALL|FCH|N;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Logical Operators
The logical operators are acting on the results of logical expressions. The precedence order of execution is first the NOT, then the AND, and finally the OR.
Template
Show the precedence of the logical operators:[[LOOP,BUSINESS_OBJECT_TYPE:1=EXT]]
True OR False AND False = [[IF:1=EXT[OR]1=INT[AND]1=INT]]True[[ELSE]]False[[ENDIF]]
(True OR False) AND False = [[IF:(1=EXT[OR]1=INT)[AND]1=INT]]True[[ELSE]]False[[ENDIF]]
False OR NOT True AND False = [[IF:1=INT[OR]!1=EXT[AND]1=INT]]True[[ELSE]]False[[ENDIF]]
False OR NOT(True AND False) = [[IF:1=INT[OR]!(1=EXT[AND]1=INT)]]True[[ELSE]]False[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Show the precedence of the logical operators:
True OR False AND False = True
(True OR False) AND False = False
False OR NOT True AND False = False
False OR NOT(True AND False) = True
Qualifier
A qualifier for a logical function can refer to a specific model element on the LOOP stack. This qualifier consists of a tag, possibly followed by a location on the stack. The dafault location is "N", which is a reference to the last model element placed on the stack.
Template
[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]][[IF:BUSINESS_OBJECT_TYPE.1=INT[AND]TYPE(1).2=Y]]
<<TYPE:C>>[[ENDIF]][[IF,TYPE(1):BUSINESS_OBJECT_TYPE.1=INT[AND]2=Y]]
<<TYPE:C>>[[ENDIF]][[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code

Product
Product
ProductPartApplication
ProductPartApplication
ProductionProces
ProductionProces
ProductionProcesStep
ProductionProcesStep
First and Last
The FIRST and LAST logical functions are referring to the first and last selected model element.
Template
[[LOOP,BUSINESS_OBJECT_TYPE:1=INT]][[IF:FIRST]]Internal Objects: [[ENDIF]]<<BUSINESS_OBJECT_TYPE:C>>[[IF:!LAST]], [[ELSE]];
[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]][[LOOP,BUSINESS_OBJECT_TYPE:1=EXT]][[IF:FIRST]]External Objects: [[ENDIF]]<<BUSINESS_OBJECT_TYPE:C>>[[IF:!LAST]], [[ELSE]];
[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]][[LOOP,BUSINESS_OBJECT_TYPE:1=INV]][[IF:FIRST]]Invalid Objects: [[ENDIF]]<<BUSINESS_OBJECT_TYPE:C>>[[IF:!LAST]], [[ELSE]];
[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Internal Objects: Order, Product, Factory;
External Objects: Customer;
Parent and Child
The PARENT and CHILD logical functions are referring to relative locations in the hierarchy.
Template
Type list:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]]
[[IF:PARENT(BUSINESS_OBJECT_TYPE:1=EXT)]]External[[ELSE]]Internal[[ENDIF]] <<TYPE:C>>[[IF:CHILD(TYPE)]]
- has child[[ENDIF]][[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]

List of internal objects with a child:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE:PARENT(BUSINESS_OBJECT_TYPE:1=INT)[AND]CHILD(TYPE)]]
- <<TYPE:C>>[[REPEAT]][[ENDLOOP,TYPE]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Type list:
External Customer
Internal Order
- has child
Internal OrderLine
Internal Product
- has child
Internal ProductPartApplication
Internal ProductionProces
- has child
Internal ProductionProcesStep
Internal Factory
- has child
Internal FactoryHall

List of internal objects with a child:
- Order
- Product
- ProductionProces
- Factory
Hierarchy Navigation
Navigate through a hierarchy of model elements of one type selected in the active LOOP functions. For a better understanding of the examples, a coding is used for the tags of model elements.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE30-BOT-000000100060]:AAA|INT|%3Cb%3EBold%3C/b%3E%0ANormal;
+TYPE[CASE30-TYP-000000100040]:AAA|AAA|N;
+TYPE[CASE30-TYP-000000100041]:BBB1|BB1|N;
+TYPE[CASE30-TYP-000000100048]:CCC11|C11|N;
=TYPE[CASE30-TYP-000000100057]:DDD111|D01|N;
-TYPE:;
+TYPE[CASE30-TYP-000000100049]:CCC12|C12|N;
=TYPE[CASE30-TYP-000000100063]:DDD121|D11|N;
=TYPE[CASE30-TYP-000000100062]:DDD122|D12|N;
-TYPE:;
+TYPE[CASE30-TYP-000000100050]:CCC13|C13|N;
=TYPE[CASE30-TYP-000000100064]:DDD131|D21|N;
=TYPE[CASE30-TYP-000000100065]:DDD132|D22|N;
=TYPE[CASE30-TYP-000000100066]:DDD133|D23|N;
-TYPE:;
-TYPE:;
+TYPE[CASE30-TYP-000000100042]:BBB2|BB2|N;
=TYPE[CASE30-TYP-000000100051]:CCC21|C21|N;
=TYPE[CASE30-TYP-000000100052]:CCC22|C22|N;
=TYPE[CASE30-TYP-000000100053]:CCC23|C2|N;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Vertical navigation
In the hierarchy selected by LOOP functions, the FORV function navigates top down (vertical) through the model elements. The template segments for the selected model elements will be exported in the order of the loop specification. The loop specification consists of two locations separated by a ">" as arrow and specifies which model elements are run through on the stack. Location references that fall outside the range are skipped.
With the FORV function, the "V" has been added for specifying the location. Next to the "N" referring to the last placed on the stack, the "V" refers to the model element selected in the FORV function. Also the V can be used in the expression.
Template
Parents for all types (with types in between):[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]]
<<TYPE>>: [[FORV:1>N-1:, ]]<<TYPE>>([[FORV:V+1>N-1:, ]]<<TYPE>>[[ENDFOR]])[[ENDFOR]][[REPEAT]][[ENDLOOP,TYPE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Parents for all types (with types in between):
AAA:
BBB1: AAA()
CCC11: AAA(BBB1), BBB1()
DDD111: AAA(BBB1, CCC11), BBB1(CCC11), CCC11()
CCC12: AAA(BBB1), BBB1()
DDD121: AAA(BBB1, CCC12), BBB1(CCC12), CCC12()
DDD122: AAA(BBB1, CCC12), BBB1(CCC12), CCC12()
CCC13: AAA(BBB1), BBB1()
DDD131: AAA(BBB1, CCC13), BBB1(CCC13), CCC13()
DDD132: AAA(BBB1, CCC13), BBB1(CCC13), CCC13()
DDD133: AAA(BBB1, CCC13), BBB1(CCC13), CCC13()
BBB2: AAA()
CCC21: AAA(BBB2), BBB2()
CCC22: AAA(BBB2), BBB2()
CCC23: AAA(BBB2), BBB2()
Horizontal Navigation
In the hierarchy selected by LOOP functions, the FORH function navigates on the same level (horizontal) through the model elements. The template segments for the selected model elements will be exported in the order of the loop specification. For the FORH function, the locations refer to the siblings in the hierarchy.
Template
All types in the hierachy with their left and right siblings:[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]][[REPEAT]][[IF:LAST]][[FORH:1>N]]
<<TYPE>> left:[[FORH:V-1>1:,]]<<TYPE>>[[ENDFOR]] right:[[FORH:V+1>N:,]]<<TYPE>>[[ENDFOR]][[ENDFOR]][[ENDIF]][[ENDLOOP,TYPE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
All types in the hierachy with their left and right siblings:
DDD111 left: right:
DDD121 left: right:DDD122
DDD122 left:DDD121 right:
DDD131 left: right:DDD132,DDD133
DDD132 left:DDD131 right:DDD133
DDD133 left:DDD132,DDD131 right:
CCC11 left: right:CCC12,CCC13
CCC12 left:CCC11 right:CCC13
CCC13 left:CCC12,CCC11 right:
CCC21 left: right:CCC22,CCC23
CCC22 left:CCC21 right:CCC23
CCC23 left:CCC22,CCC21 right:
BBB1 left: right:BBB2
BBB2 left:BBB1 right:
AAA left: right:
Replacement References
A replacement label refers to a model element property and can also refer to another model element on the LOOP stack.
Template
All types (with root and parent) with the types in the branch (with parent and child):[[LOOP,BUSINESS_OBJECT_TYPE]][[LOOP,TYPE]]
<<TYPE>>: Root=<<TYPE(1)>> Parent=[[IF:!ROOT]]<<TYPE(N-1)>>[[ENDIF]][[FOR:2>N-1]]
- <<TYPE>> Parent=<<TYPE(V-1)>> Child=<<TYPE(V+1)>>[[ENDFOR]][[REPEAT]][[ENDLOOP,TYPE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
All types (with root and parent) with the types in the branch (with parent and child):
AAA: Root=AAA Parent=
BBB1: Root=AAA Parent=AAA
CCC11: Root=AAA Parent=BBB1
- BBB1 Parent=AAA Child=CCC11
DDD111: Root=AAA Parent=CCC11
- BBB1 Parent=AAA Child=CCC11
- CCC11 Parent=BBB1 Child=DDD111
CCC12: Root=AAA Parent=BBB1
- BBB1 Parent=AAA Child=CCC12
DDD121: Root=AAA Parent=CCC12
- BBB1 Parent=AAA Child=CCC12
- CCC12 Parent=BBB1 Child=DDD121
DDD122: Root=AAA Parent=CCC12
- BBB1 Parent=AAA Child=CCC12
- CCC12 Parent=BBB1 Child=DDD122
CCC13: Root=AAA Parent=BBB1
- BBB1 Parent=AAA Child=CCC13
DDD131: Root=AAA Parent=CCC13
- BBB1 Parent=AAA Child=CCC13
- CCC13 Parent=BBB1 Child=DDD131
DDD132: Root=AAA Parent=CCC13
- BBB1 Parent=AAA Child=CCC13
- CCC13 Parent=BBB1 Child=DDD132
DDD133: Root=AAA Parent=CCC13
- BBB1 Parent=AAA Child=CCC13
- CCC13 Parent=BBB1 Child=DDD133
BBB2: Root=AAA Parent=AAA
CCC21: Root=AAA Parent=BBB2
- BBB2 Parent=AAA Child=CCC21
CCC22: Root=AAA Parent=BBB2
- BBB2 Parent=AAA Child=CCC22
CCC23: Root=AAA Parent=BBB2
- BBB2 Parent=AAA Child=CCC23
Replacement Functions
Manipulate the export of the model element texts or replace the references with model element properties.
Cube Model
=BUSINESS_OBJECT_TYPE[CASE40-BOT-000000100060]:AAA|INT|%3Cb%3EBold%3C/b%3E%0ANormal;
=BUSINESS_OBJECT_TYPE[CASE40-BOT-000000100040]:CUSTOMER|EXT|customer_files;
=BUSINESS_OBJECT_TYPE[CASE40-BOT-000000100024]:ORDER|INT|order_directory;
=BUSINESS_OBJECT_TYPE[CASE40-BOT-000000100025]:PRODUCT|INT|product_definitions;
Manipulate Text
Manipulate the exported text of the model element properties by a function.
Template
[[LOOP,BUSINESS_OBJECT_TYPE:!0=AAA]]Unchanged: <<BUSINESS_OBJECT_TYPE>>, <<BUSINESS_OBJECT_TYPE2>>
Uppercase: <<BUSINESS_OBJECT_TYPE:U>>, <<BUSINESS_OBJECT_TYPE2:U>>
Lowercase: <<BUSINESS_OBJECT_TYPE:L>>, <<BUSINESS_OBJECT_TYPE2:L>>
Camelcase: <<BUSINESS_OBJECT_TYPE:L>>, <<BUSINESS_OBJECT_TYPE2:C>>

[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Unchanged: CUSTOMER, customer_files
Uppercase: CUSTOMER, CUSTOMER_FILES
Lowercase: customer, customer_files
Camelcase: customer, CustomerFiles

Unchanged: ORDER, order_directory
Uppercase: ORDER, ORDER_DIRECTORY
Lowercase: order, order_directory
Camelcase: order, OrderDirectory

Unchanged: PRODUCT, product_definitions
Uppercase: PRODUCT, PRODUCT_DEFINITIONS
Lowercase: product, product_definitions
Camelcase: product, ProductDefinitions

Property Replacements
Export a model property of the model element.
Template
[[LOOP,BUSINESS_OBJECT_TYPE:!0=AAA]]Unique Number : <<BUSINESS_OBJECT_TYPE:N>>
Sub Number : <<BUSINESS_OBJECT_TYPE:S>> (serial number within parent model element)
Index : <<BUSINESS_OBJECT_TYPE:IX>> (serial number within the LOOP selection)
Cube Identifier: <<BUSINESS_OBJECT_TYPE:I>>

[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Unique Number : 00088
Sub Number : 002 (serial number within parent model element)
Index : 1 (serial number within the LOOP selection)
Cube Identifier: CASE40-BOT-000000100040

Unique Number : 00089
Sub Number : 003 (serial number within parent model element)
Index : 2 (serial number within the LOOP selection)
Cube Identifier: CASE40-BOT-000000100024

Unique Number : 00090
Sub Number : 004 (serial number within parent model element)
Index : 3 (serial number within the LOOP selection)
Cube Identifier: CASE40-BOT-000000100025

Character Escaping
Escape characters in the exported text of the model element properties by a function.
Template
[[LOOP,BUSINESS_OBJECT_TYPE:0=AAA]]Plain text:
<<BUSINESS_OBJECT_TYPE2>>
Percent escapes:
<<BUSINESS_OBJECT_TYPE2:P>>
HTML escapes (with HTML break):
<<BUSINESS_OBJECT_TYPE2:H>>
HTML escapes (with linefeed):
<<BUSINESS_OBJECT_TYPE2:HE>>
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Plain text:
<b>Bold</b>
Normal
Percent escapes:
%3Cb%3EBold%3C%2Fb%3E%0ANormal
HTML escapes (with HTML break):
&lt;b&gt;Bold&lt;/b&gt;<br>Normal
HTML escapes (with linefeed):
&lt;b&gt;Bold&lt;/b&gt;
Normal
HTML / Percent Encoding
Apply the HTML escape or URI escacpe (Percent escape) functions to the text within the loop, using LOOP_HTML and LOOP_PERC functions.
Template
The result of LOOP also presented In HTML and percentage escaping:
[[LOOP,BUSINESS_OBJECT_TYPE:!0=AAA]]<<<BUSINESS_OBJECT_TYPE:C>>/>
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
HTML:
[[LOOP_HTML,BUSINESS_OBJECT_TYPE:!0=AAA]]<<<BUSINESS_OBJECT_TYPE:C>>/>
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
PERC:
[[LOOP_PERC,BUSINESS_OBJECT_TYPE:!0=AAA]]<<<BUSINESS_OBJECT_TYPE:C>>/>
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
The result of LOOP also presented In HTML and percentage escaping:
<Customer/>
<Order/>
<Product/>

HTML:
&lt;Customer/&gt;<br>&lt;Order/&gt;<br>&lt;Product/&gt;<br>
PERC:
%3CCustomer%2F%3E%0A%3COrder%2F%3E%0A%3CProduct%2F%3E%0A
Reusable Text
Cube Model
=BUSINESS_OBJECT_TYPE[CASE45-BOT-000000100040]:CUSTOMER|EXT|customer_files;
=BUSINESS_OBJECT_TYPE[CASE45-BOT-000000100024]:ORDER|INT|order_directory;
=BUSINESS_OBJECT_TYPE[CASE45-BOT-000000100025]:PRODUCT|INT|product_definitions;
=BUSINESS_OBJECT_TYPE[CASE45-BOT-000000100100]:FACTORY|INT|production_locations;
Text Blocks / Text Labels
Text blocks are defined for reuse of template segments. The text may contain labels that are replaced with arguments that are defined at the place where the text is applied.
Template
[[TEXT,OBJECT_LIST]][[LOOP,BUSINESS_OBJECT_TYPE:1=<<T1>>]][[IF:FIRST]]<<T2>> Objects: [[ENDIF]]<<BUSINESS_OBJECT_TYPE:C>>[[IF:!LAST]], [[ELSE]];
[[ENDIF]][[ENDLOOP,BUSINESS_OBJECT_TYPE]][[ENDTEXT]]
[[BODY]]<<TEXT,OBJECT_LIST[|]INT[|]Internal[|]>><<TEXT,OBJECT_LIST[|]EXT[|]External[|]>><<TEXT,OBJECT_LIST[|]INV[|]Invalid[|]>>[[ENDBODY]]
Code
Internal Objects: Order, Product, Factory;
External Objects: Customer;
External Functions
Perl expressions can be used for special functionality that is not available as standard CubeGen functions.
Cube Model
=BUSINESS_OBJECT_TYPE[CASE50-BOT-000000100040]:CUSTOMER|EXT|customer_files;
=BUSINESS_OBJECT_TYPE[CASE50-BOT-000000100025]:PRODUCT|INT|product_definitions;
=BUSINESS_OBJECT_TYPE[CASE50-BOT-000000100024]:ORDER|INT|order_directory;
Perl Expressions
The DECL and EVAL functions are performing the Perl eval statement. Only the EVAL function (not the logical expression) exports te result to the code. This can be suppressed by putting the Perl expression between parentheses.
Template
Total length (bits) of the names:[[DECL:sub myLen{return 8*length(@_[0])}]][[LOOP,BUSINESS_OBJECT_TYPE]]
[[IF:EVAL:myLen('<<BUSINESS_OBJECT_TYPE>>')<48]]Next with one additional byte.
[[EVAL:($myC+=8)]][[ENDIF]]<<BUSINESS_OBJECT_TYPE>>: [[EVAL:$myC+=myLen('<<BUSINESS_OBJECT_TYPE>>')]][[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Total length (bits) of the names:
CUSTOMER: 64
PRODUCT: 120
Next with one additional byte.
ORDER: 168
Sequential Processing
Export the model elements in the order as they appaer in de Cube model.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE60-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE60-TYP-000000100020]:ORDER|ORD|N;
=ATTRIBUTE[CASE60-ATB-000000100005]:NUMBER|N;
=ATTRIBUTE[CASE60-ATB-000000100006]:DELIVERY_DATE|N;
=ATTRIBUTE[CASE60-ATB-000000100003]:DESCRIPTION|N;
+TYPE[CASE60-TYP-000000100022]:ORDER_LINE|ORL|Y;
=ATTRIBUTE[CASE60-ATB-000000100020]:NUMBER|Y;
=ATTRIBUTE[CASE60-ATB-000000100021]:DESCRIPTION|N;
=ATTRIBUTE[CASE60-ATB-000099900138]:STATUS|N;
-TYPE:;
=ATTRIBUTE[CASE60-ATB-000099900132]:STATUS|N;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Sequential Iterations
The model elements referenced by the LOOP functions nested in the SEQUENCE function are exported in the order as they appear in the Cube model.
Template
[[LOOP,BUSINESS_OBJECT_TYPE]]Structure of <<BUSINESS_OBJECT_TYPE:C>>:[[SEQUENCE]][[LOOP,ATTRIBUTE]]
- Attribute: <<ATTRIBUTE:C>>[[ENDLOOP,ATTRIBUTE]][[LOOP,TYPE]]
- Type: <<TYPE:C>>[[REPEAT:TAB]][[ENDLOOP,TYPE]][[ENDSEQUENCE]]
[[ENDLOOP,BUSINESS_OBJECT_TYPE]]
Code
Structure of Order:
- Type: Order
- Attribute: Number
- Attribute: DeliveryDate
- Attribute: Description
- Type: OrderLine
- Attribute: Number
- Attribute: Description
- Attribute: Status
- Attribute: Status
Model Enhancement
The CUBE development framework has steps in which a cube model is copied with a number of enhancements. CubeGen has functions especially for supporting these steps.
Cube Model
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100040]:CUSTOMER|EXT|customer_files;
+TYPE[CASE90-TYP-000000100021]:CUSTOMER|CUS|N;
=ATTRIBUTE[CASE90-ATB-000000100004]:RELATION_NUMBER|Y;
=ATTRIBUTE[CASE90-ATB-000000100001]:NAME|N;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE90-TYP-000000100020]:ORDER|ORD|N;
=ATTRIBUTE[CASE90-ATB-000000100005]:NUMBER|N;
=ATTRIBUTE[CASE90-ATB-000000100006]:DELIVERY_DATE|N;
=ATTRIBUTE[CASE90-ATB-000000100003]:DESCRIPTION|N;
+REFERENCE[CASE90-REF-000000100000]:IS_PLACED_BY|N;
>REFERENCE_TYPE:CASE90-TYP-000000100021;
-REFERENCE:;
+TYPE[CASE90-TYP-000000100022]:ORDER_LINE|ORL|Y;
=ATTRIBUTE[CASE90-ATB-000000100020]:NUMBER|Y;
=ATTRIBUTE[CASE90-ATB-000000100021]:DESCRIPTION|N;
+REFERENCE[CASE90-REF-000000100001]:CONCERNS|Y;
>REFERENCE_TYPE:CASE90-TYP-000000100000;
-REFERENCE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE90-TYP-000000100000]:PRODUCT|PRD|Y;
=ATTRIBUTE[CASE90-ATB-000000100007]:CODE|Y;
+TYPE[CASE90-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
=ATTRIBUTE[CASE90-ATB-000000100008]:CODE|Y;
=ATTRIBUTE[CASE90-ATB-000000100010]:COUNT|N;
-TYPE:;
+TYPE[CASE90-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
=ATTRIBUTE[CASE90-ATB-000000100012]:PROCES_ID|Y;
+TYPE[CASE90-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
=ATTRIBUTE[CASE90-ATB-000000100013]:PROCES_STEP_ID|Y;
=ATTRIBUTE[CASE90-ATB-000000100014]:DESCRIPTION|N;
-TYPE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Wildcard
Instead of a tag, an "*" can be used to apply a template function for all model elements.
The VALUE function is used to copy a specified number of model element values.
Template
! Copied model[[LOOP,*]]
+<<*TAG>>[[IF:!ID()]][<<*:I>>][[ENDIF]]:[[VALUE,*:0>N:|]];[[REPEAT:TAB]][[LOOP,>*]]
><<*TAG>>:<<*:I>>;[[ENDLOOP,>*]]
-<<*TAG>>:;[[ENDLOOP,*]]
Code
! Copied model
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100040]:CUSTOMER|EXT|customer_files;
+TYPE[CASE90-TYP-000000100021]:CUSTOMER|CUS|N;
+ATTRIBUTE[CASE90-ATB-000000100004]:RELATION_NUMBER|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100001]:NAME|N;
-ATTRIBUTE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE90-TYP-000000100020]:ORDER|ORD|N;
+ATTRIBUTE[CASE90-ATB-000000100005]:NUMBER|N;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100006]:DELIVERY_DATE|N;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100003]:DESCRIPTION|N;
-ATTRIBUTE:;
+REFERENCE[CASE90-REF-000000100000]:IS_PLACED_BY|N;
>REFERENCE_TYPE:CASE90-TYP-000000100021;
-REFERENCE:;
+TYPE[CASE90-TYP-000000100022]:ORDER_LINE|ORL|Y;
+ATTRIBUTE[CASE90-ATB-000000100020]:NUMBER|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100021]:DESCRIPTION|N;
-ATTRIBUTE:;
+REFERENCE[CASE90-REF-000000100001]:CONCERNS|Y;
>REFERENCE_TYPE:CASE90-TYP-000000100000;
-REFERENCE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE90-TYP-000000100000]:PRODUCT|PRD|Y;
+ATTRIBUTE[CASE90-ATB-000000100007]:CODE|Y;
-ATTRIBUTE:;
+TYPE[CASE90-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
+ATTRIBUTE[CASE90-ATB-000000100008]:CODE|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100010]:COUNT|N;
-ATTRIBUTE:;
-TYPE:;
+TYPE[CASE90-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
+ATTRIBUTE[CASE90-ATB-000000100012]:PROCES_ID|Y;
-ATTRIBUTE:;
+TYPE[CASE90-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
+ATTRIBUTE[CASE90-ATB-000000100013]:PROCES_STEP_ID|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100014]:DESCRIPTION|N;
-ATTRIBUTE:;
-TYPE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Enhance Model
In the generic model copy function texts can be added as specific enhancements. The TAG logical function has been added to select the concerning model elements.
Template
! Model enhanced with foreign keys[[LOOP,*]]
+<<*TAG>>[[IF:!ID()]][<<*:I>>][[ENDIF]]:[[VALUE,*:0>N:|]];[[IF:TAG(TYPE)]][[LOOP,REFERENCE]][[LOOP,REFERENCE_TYPE]][[LOOP,ATTRIBUTE:1=Y]]
=FOREIGN_KEY:FK_<<REFERENCE_TYPE1>>_<<ATTRIBUTE>>|<<REFERENCE1>>;[[ENDLOOP,ATTRIBUTE]][[ENDLOOP,REFERENCE_TYPE]][[ENDLOOP,REFERENCE]][[ENDIF]][[REPEAT:TAB]][[LOOP,>*]]
><<*TAG>>:<<*:I>>;[[ENDLOOP,>*]]
-<<*TAG>>:;[[ENDLOOP,*]]
Code
! Model enhanced with foreign keys
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100040]:CUSTOMER|EXT|customer_files;
+TYPE[CASE90-TYP-000000100021]:CUSTOMER|CUS|N;
+ATTRIBUTE[CASE90-ATB-000000100004]:RELATION_NUMBER|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100001]:NAME|N;
-ATTRIBUTE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100024]:ORDER|INT|order_directory;
+TYPE[CASE90-TYP-000000100020]:ORDER|ORD|N;
=FOREIGN_KEY:FK_CUS_RELATION_NUMBER|N;
+ATTRIBUTE[CASE90-ATB-000000100005]:NUMBER|N;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100006]:DELIVERY_DATE|N;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100003]:DESCRIPTION|N;
-ATTRIBUTE:;
+REFERENCE[CASE90-REF-000000100000]:IS_PLACED_BY|N;
>REFERENCE_TYPE:CASE90-TYP-000000100021;
-REFERENCE:;
+TYPE[CASE90-TYP-000000100022]:ORDER_LINE|ORL|Y;
=FOREIGN_KEY:FK_PRD_CODE|Y;
+ATTRIBUTE[CASE90-ATB-000000100020]:NUMBER|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100021]:DESCRIPTION|N;
-ATTRIBUTE:;
+REFERENCE[CASE90-REF-000000100001]:CONCERNS|Y;
>REFERENCE_TYPE:CASE90-TYP-000000100000;
-REFERENCE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
+BUSINESS_OBJECT_TYPE[CASE90-BOT-000000100025]:PRODUCT|INT|product_definitions;
+TYPE[CASE90-TYP-000000100000]:PRODUCT|PRD|Y;
+ATTRIBUTE[CASE90-ATB-000000100007]:CODE|Y;
-ATTRIBUTE:;
+TYPE[CASE90-TYP-000000100004]:PRODUCT_PART_APPLICATION|PPA|Y;
+ATTRIBUTE[CASE90-ATB-000000100008]:CODE|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100010]:COUNT|N;
-ATTRIBUTE:;
-TYPE:;
+TYPE[CASE90-TYP-000000100002]:PRODUCTION_PROCES|PPR|N;
+ATTRIBUTE[CASE90-ATB-000000100012]:PROCES_ID|Y;
-ATTRIBUTE:;
+TYPE[CASE90-TYP-000000100003]:PRODUCTION_PROCES_STEP|PPS|N;
+ATTRIBUTE[CASE90-ATB-000000100013]:PROCES_STEP_ID|Y;
-ATTRIBUTE:;
+ATTRIBUTE[CASE90-ATB-000000100014]:DESCRIPTION|N;
-ATTRIBUTE:;
-TYPE:;
-TYPE:;
-TYPE:;
-BUSINESS_OBJECT_TYPE:;
Template Functions
Functions that are applied In the templates to navigate through the hierarchy of the model elements and then export the selected template segments. In addition to navigation functions, there are functions for replacing the labels in the texts to be exported.
BODY
The BODY function selects the part of the template file or include file that is being exported. Only one BODY function can be applied per file. If the file contains no BODY function, the entire file is exported.
... [[BODY]] ... [[ENDBODY]] ...
DECL
Perform the Perl eval expression once to decclare in functions or variables. To prefix the names with "my", they will not mixed up to the CubeGen code.
[[DECL:<perl_expression>]]
EVAL
Export the result of a Perl exprssion. When the Perl expression is placed between parentheses, the result is not exported. To prefix the names with "my", they will not mixed up to the CubeGen code.
The <perl_expression> can contain labels that will be replaced by model element property values.
[[EVAL:<perl_expression>]]
[[EVAL:(<perl_expression>)]]
FILE
The FILE function switches over to another code file during the generation process. The <file_name> can also contain a path reference and labels that will be replaced by a model element property value or parameter value.
[[FILE,<file_name>]]
FOR
Equal to FORV.
FORH
In the hierarchy selected by LOOP functions, the FORH function navigates on the same level (horizontal) through the model elements of the specified (by the tag) or actual type. The template segments for the selected model elements will be exported in the order of the loop specification, possibly separated by a specified string.
In case of just tag ROOT the FORH function navigates to the top of the hierarchy.
[[FORH:<loopspec>]] ... [[ENDFOR]]
[[FORH,<tag>:<loopspec>]] ... [[ENDFOR]]
[[FORH:<loopspec>:<seperator>]] ... [[ENDFOR]]
[[FORH,<tag>:<loopspec>:<seperator>]] ... [[ENDFOR]]
[[FORH,ROOT]] ... [[ENDFOR]]
FORV
In the hierarchy selected by LOOP functions, the FORV function navigates top down (vertical) through the model elements of the tag specified (by the tag) or actual type. The template segments for the selected model elements will be exported in the order of the loop specification, possibly separated by a specified string.
In case of just tag ROOT the FORV function navigates to the top of the hierarchy.

[[FORV:<loopspec>]] ... [[ENDFOR]]
[[FORV,<tag>:<loopspec>]] ... [[ENDFOR]]
[[FORV:<loopspec>:<seperator>]] ... [[ENDFOR]]
[[FORV,<tag>:<loopspec>:<seperator>]] ... [[ENDFOR]]
[[FORV,ROOT]] ... [[ENDFOR]]
IF
Export a template segment that applies to a condition (logical_expression). By default, the logical functions in the logical expression work on the model elements that are selected within the valid loop. If a tag for the colon is filled, the model elements of this tag are used by default. This tag can be overruled by a tag that can be defined for the logical function.
[[IF:<(logical_expression>]] ... [[ENDIF]]
[[IF,<tag>:<(logical_expression>]] ... [[ENDIF]]
[[IF,<tag>(<location>):<(logical_expression>]] ... [[ENDIF]]
[[IF~~~]] ... [[ELSIF~~~]] ... [[ELSE]] ... [[ENDIF]]
INCLUDE
Template segments can be included from another file. The filename can also contain a path reference.
[[INCLUDE,<<file_name>>]]
LOOP
Export the template segment for the model elements that (optionally) meet the logical expression for the specified tag in sequential order .
[[LOOP,<tag>]] ... [[ENDLOOP,<tag>]]
[[LOOP,<tag>:<(logical_expression>]] ... [[ENDLOOP,<tag>]]
REPEAT
Repeat the LOOP function for all underlying model elements of the specified type. The indentation of the exported text can be increased by one or more tabs. (eg. TAB, 2TAB, 3TAB, ...)
[[LOOP,<tag>]] ... [[REPEAT]] ... [[ENDLOOP,<tag>]]
[[LOOP,<tag>]] ... [[REPEAT:nTAB]] ... [[ENDLOOP,<tag>]]
[[LOOP,<tag>]] ... [[LOOP...]] ... [[REPEAT,<tag>]] ... [[ENDLOOP...]] ... [[ENDLOOP,<tag>]]
[[LOOP,<tag>]] ... [[LOOP...]] ... [[REPEAT,<tag>:nTAB]] ... [[ENDLOOP...]] ... [[ENDLOOP,<tag>]]
SEQUENCE
The model elements referenced by the LOOP functions nested in the SEQUENCE function are exported in the order as they appear in the Cube model. The text within the SEQUENCE function and outside the nested LOOP function is ignored, and will not be exported.
[[SEQUENCE]]
[[LOOP,<tag1>]] ... [[ENDLOOP,<tag1>]]
[[LOOP,<tag2>]] ... [[ENDLOOP,<tag2>]]
...
[[LOOP,<tagN>]] ... [[ENDLOOP,<tagN>]]
[[ENDSEQUENCE]]
TABS
Increase or decrease indentation of the current and following text segments. To decrease indentation specify a negative increment.
[[TABS:<increment>]]
TEMPLATE
Process a model element property as a template segment.
[[TEMPLATE:<tag>]]
[[TEMPLATE:<tag>(<location>)]]
[[TEMPLATE:<tag>(<location>)<property>]]
[[TEMPLATE:<tag>:<function>]]
[[TEMPLATE:<tag>(<location>):<function>]]
[[TEMPLATE:<tag>(<location>)<property>:<function>]]
TEXT
Text blocks are defined for reuse of template segments. The text may contain labels that are replaced with arguments that are defined at the place where the text is applied. The optional list of arguments starts and ends with the separator "[|]". The text is only exported at the location of the text labels. The text blocks themselves are not exported.
The indentation of the exported text can be increased by one or more tabs. (eg. TAB, 2TAB, 3TAB, ...)
[[TEXT,<name>]] ... [[ENDTEXT]]
<<TEXT,<name>>>
<<TEXT:nTAB,<name>>>

[[TEXT,<name>]] ... <<T1>> ... <<T2>> ... [[ENDTEXT]]
<<TEXT,<name>[|]<parm1>[|]<parm2>[|]>>
<<TEXT:nTAB,<name>[|]<parm1>[|]<parm2>[|]>>
VALUE
Export the properties of a model element.
[[VALUE,<tag>:<loop_spec>:<separator>]]
comment
Text that is not exported.
[[* ... *]]
parameters
The parameters specified on the command line can be selected for export. Only the replace functions L (lowercase) and U (uppercase) are supported.
<<<parm_number>>>
<<<parm_number>:<function>>>
replacement
Replace a label with a model value.
<<<tag>>>
<<<tag>(<location>)>>
<<<tag><property>>>
<<<tag>(<location>)<property>>>
<<<tag>:<function>>>
<<<tag>(<location>):<function>>>
<<<tag><property>:<function>>>
<<<tag>(<location>)<property>:<function>>>
Logical Functions
The logical functions are the elements of the logical expressions.
AND
Perform the logical AND function on the results of two logical expressions.
<logical_expression>[AND]<logical_expression>
CHILD
Check that the current model element for the concerned tag has a child model element with the specified tag (or all for *) that meets (optionally) the specified logical expression.
CHILD(<tag>)
CHILD(*)
CHILD(<tag>:<logical_expression>)
<tag>.CHILD(~~~)
<tag>(<location>).CHILD(~~~)
EVAL
Perform a logical Perl expression.
The <perl logicsal expression> can contain labels that will be replaced by a model element property value.
EVAL:<perl_logical_expression>
FIRST
Check that it is the first selected model element in the LOOP for the concerned tag.
FIRST
<tag>.FIRST
<tag>(<location>).FIRST
ID
Check for the id of the actual model element.
The <value> can contain labels that will be replaced by a model element property value.
ID(<value>)
<tag>.ID(<value>)
<tag>(<location>).ID(<value>)
LAST
Check that it is the last selected model element in the LOOP for the concerned tag.
LAST
<tag>.LAST
<tag>(<location>).LAST
LEVEL
Check that the model element is of the specified level in the hierachy of the REPEAT LOOP for the concerned tag. So LEVEL(1) checks for the root model element.
LEVEL(<repeat_level>)
<tag>.LEVEL(<repeat_level>)
<tag>(<location>).LEVEL(<repeat_level>)
NOT
Invert the result of a logical expression.
!<logical_expression>
OR
Perform the logical OR function on the results of two logical expressions.
<logical_expression>[OR]<logical_expression>
PARENT
Check that the current model element for the concerned tag has a parent model element with the specified tag that meets (optionally) the specified logical expression.
PARENT(<tag>)
PARENT(<tag>:<logical_expression>)
<tag>.PARENT(~~~)
<tag>(<location>).PARENT(~~~)
ROOT
Check that the model element is the root of the hierachy of the REPEAT LOOP for the concerned tag.
ROOT
<tag>.ROOT
<tag>(<location>).ROOT
TAG
Check for the type of the actual model element.
TAG(<tag>)
parameter=
The parameters specified on the command line can be referenced in the "is equal to" logical expression.
The <value> can contain labels that will be replaced by a model element property value or parameter value.
P<parm_number>=<value>
parentheses
Parentheses are used in the logical expressions to define the precedence of the AND,OR and NOT operations.
!(<logical_expression>[AND](<logical_expression>[OR]<logical_expression>))
property=
A model element property can be referenced in the "is equal to" logical expression.
The <value> can contain labels that will be replaced by a model element property value or parameter value.
<property_number>=<value>
<tag>.<property_number>=<value>
<tag>(<location>).<property_number>=<value>










































































MODEL



TEMPLATE



CODE