Configuring SingleIteration for SubTemplates
Optimizing SubTemplate Behavior with SingleIteration
1. Introduction
The SingleIteration flag introduces enhanced control over SubTemplate objects in PBDesigner. This flag allows for single iterations of a SubTemplate section for each new iteration of the parent section in the main template.
2. Feature Overview
The SingleIteration flag is an optional property of SubTemplate objects:
- Default Value:
0(FALSE). - When set to 1 (TRUE): The SubTemplate section performs a single iteration for each new iteration of the parent section.
Controlling SingleIteration via Scripts
The flag can be manipulated programmatically using scripts:
# Get the current state of SingleIteration
isSingleIteration = obj.singleiteration
# Set SingleIteration to TRUE
obj.singleiteration = 1
3. Configuring the SingleIteration Flag in PBDesigner
The SingleIteration parameter can be set directly within the SubTemplate properties in PBDesigner. To configure it:
- Open the SubTemplate properties window in PBDesigner.
- Locate the
SingleIterationfield and set its value to1for single iteration behavior.
Below is an example of the configuration in PBDesigner:
4. Defining SingleIteration in FMT Files
If you need to modify the flag manually in the template file (FMT), follow these steps:
- Open the FMT file in a text editor (e.g., Notepad++).
- Locate the section corresponding to your SubTemplate object. For example:
[Subtemplate 641]
Name=Subtemplate2
SingleIteration=1
Save the changes and reload the template to apply the updated behavior.
5. Use Cases
Here are some scenarios where the SingleIteration flag can be beneficial:
- Generating reports where SubTemplate sections must align with parent iterations.
- Reducing redundant iterations for specific design patterns.
- Optimizing processing time for templates with nested SubTemplates.
6. Expected Behavior
- When
SingleIteration=1, the SubTemplate performs one iteration per parent iteration. - When
SingleIteration=0, the SubTemplate performs multiple iterations as per its default logic.
7. Additional Notes
- This feature is available in PBDesigner and Engine starting from version 7.01.43.
- Ensure proper testing when using this flag to avoid unintended behavior in complex templates.
- Contact your administrator or consult the documentation for advanced use cases.