Render Test Script Step Description Rich Text (XHTML) with Execution Variables

How to extract and render Test Script Step Description Rich Text (XHTML) with Execution Variables.

Thanks to Jeffrey Babylon for making time to write this article and sharing it with all of us.

Note: The following Test Script Steps below assume your RPE template already retrieves the Test Script or execution result where the steps live. Continue reading “Render Test Script Step Description Rich Text (XHTML) with Execution Variables”

JavaScript improvements with Rational Publishing Engine 2.1.1

JavaScript is one of the key components while building a Rational Publishing Engine (RPE) template. The plain JavaScript dialog editor has been improved with:

  • Content Assist: Ctrl + space lists available variables, helps with syntax of various JavaScript functions, parameters to be passed to a function. Tip: If the variable is a data attribute from a query, store it in a JavaScript variable to take advantage of content assist.
  • Syntax coloring: For any programming language, syntax coloring is a must.
  • Line marking: The line containing the cursor has a line marking.

Find more at

Understanding type of the model from DM

While building a cross product template from DNG to Design manager, the derived by attribute links to model diagram from Design Manager. How do you know whether it is a use case diagram or sequence diagram or something else?

If you make a GET request to DM model OSLC  / permanent URL (https://server:9443/dm/models/_Eea40KY8EeWtTLergOJe7g~OLDID__6018453__1) with Accept header as application/rdf+xml, you get OSLC representation of the resource. Looking at RDF/Description/type@resource attribute mentions whether the model is a use case or sequence diagram or etc. Continue reading “Understanding type of the model from DM”

Share variable across templates

There might be a scenario where you want to share a variable value across templates within a document specification. This is not supported directly using RPE template variable. However this could be achieved using Java system variable.

Note: Once the Java system variable is set, the variable value is available during future document generation until RPE Launcher / Studio is restarted. Hence, make sure to reset such variable value at the beginning of the template to avoid unnecessary results.

During concurrent document generation, if same variable name is used, it could result in inconsistent value. Hence, create a very unique variable name for using across document specifications. You could log (using _sessionLogger) the variable value before using them for printing. Continue reading “Share variable across templates”

New in RPE 2.1: ReUse JavaScript functions in template

RPE 2.1 allows the template designer to define JavaScript libraries/functions within the RPE template. The functions defined in those libraries are visible in all the other elements within the same template.


To mark a JavaScript element as a library, enable “Library script” property. Once enabled, the element name changes to “JavaScript Library“. The functions defined in such JavaScript library is available to all other elements within the template.

Watch the video on JavaScript reuse  in RPE template, created by my colleague Subramanya Prasad.

Continue reading “New in RPE 2.1: ReUse JavaScript functions in template”

Best Practices for building RPE Template – Part 1

It is important to build RPE template by following standard guidelines so that it would help greatly in maintaining the template for longer time. I’ll not target any specific data source here. These are general guidelines that could be followed while building or updating RPE template.


General Guidelines

  • Have separate templates for title, contents, end game so that some of them could be reused across document specifications. Include multiple templates in a single document specification (dsx) for document generation.
    • Whenever possible, use style sheet (word template) for title page instead of building it within RPE template. You could use the style sheet for Word and PDF output formats in document specification.
  • Keep templates small so that it can be managed easily for longer time.
  • Use notes (text) file to store various examples URLs. These will act as quick help while looking for data source and schema URLs. The same goes for JavaScript codes.

Part 2 – Template creation guidelines


Using JavaScript Objects/Arrays during iteration

When a JavaScript Array is populated with attributes within query on a container, you will notice that the Array object holds data for future iterations of the query while in the current iteration. This is because of how RPE processes the data and write to the output document in separate threads.

The solution here is to use additional variable called _arrayLength, which should be incremented for every query iteration and any operation on the Array should be through _arrayLength RPE variable.


Continue reading “Using JavaScript Objects/Arrays during iteration”