Best Practices for building RPE Template – Part 2

Continuing from Best Practices for building RPE Template – Part 1

Template creation guidelines


  • Debug statements Have debug statements within the template at different stages using _sessionLogger default internal variable. Control printing of debug statements using your own internal RPE variable (say _debugEnabled).
  • Session Information: Get session information like output path, template path, etc using _sessionInfo default internal variable. See details at Accessing the docgen configuration information in JavaScript.
  • Template comment: Add template comment element at different stages within the template explaining what the current section is used for. This would act as self documenting the template.
    • Template element: Provide name and descriptions to template elements. This helps understanding the purpose of the element template when you or others read the template after some time.

  • Naming convention: Follow standard naming convention for variables and data sources as they would be self explanatory in most of the cases. Additionally, provide description for each data source and variable to provide more details on what it is being used for.
  • Prefer JavaScript template element over Container element for variable assignment as JavaScript is easy to view and helps in faster edition within RPE Studio.
  • Dynamic Data Source Configuration (DSC) element
    • In most of the scenarios, the DSC element connection details are inherited from it’s parent. In such cases, inherit data configuration from parent data source instead of configuring it again.
    • Hide data sources that are being configured by parent data source by setting “Configuration required” property value to “hidden”
  • Do not forget to run your template after every logical point, while building the template, against the data source. You could run it in preview mode and fix any discrepancies then and there.
  • Make versioned backups of your templates (MyTemplate-V01.dta, MyTemplate-V02.dta, MyTemplate-V03.dta). When you are happy with a template you can delete old versions.

I found more best practices on specific topics from earlier posts

Best practices for table design in RPE

How to move queries


Author: Kumaraswamy M

Kumar is an architect for Rational Publishing Engine. He has been with the product for more than 4 years and has been involved in many releases of RPE. His expertise are in Web application development and API design. He loves going on a long ride on bike and conquering peaks during weekend treks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s