Creating conditions for template elements
Procedure
Results
When you apply a condition to an element,
the element displays with an
icon in the template content editor:

Examples: Constructing conditions with the condition editor
Review these examples to help you construct your own conditions with the condition editor.
- Expand .
- Select [Object Heading] Object_Heading.
- For the left operand, select [Object Heading] Object_Heading.
- For the Operator, select Not equal to.
- For the right operand, do not enter any value.
- Click Add. The JavaScript displays as Object_Heading != "".
- Expand .
- Select Priority.
- For the left operand, select Priority.
- For the Operator, select Equals.
- For the right operand, enter High.
- Click Add. The JavaScript displays as Priority == "High".
- Expand .
- Select the variable.
- For the left operand, select the variable.
- For the Operator, select Equals.
- For the right operand, do not enter any value.
- Click Add. The JavaScript displays as variable == "".
What to do next
In some cases, the value of a variable evaluates to a boolean value rather than the literal string value. Example: variable == "true" incorrectly evaluates to false if variable is the boolean true and not the string "true". Instead of looking for the existence of any value, the word true is not found in the data as a value. This issue occurs when a variable comes from a computation and not from either a document specification where it was provided when the report was configured or from a template where it was specified as the default value of the variable.
- Option 1: Enable your condition to handle both the literal string
and the boolean value.
(variable == boolean_true_or_false) || ( variable == "string")
Example: (variable == true) || ( variable == "true")
- Option 2: If you know in advance that the variable is to evaluate
either as a boolean or string value, you can design the condition
in anticipation of that value type.
- Boolean value: variable == boolean_true_or_false
Example: variable == true
- String value: variable == "string"
Example: variable == "true"
- Boolean value: variable == boolean_true_or_false
Creating an alias for attributes with the same names
Before you begin
- Rational Publishing Engine Document Studio, click .
- Expand RPE and click Document design.
- In the Use Schema annotations for display field, select No and click OK.
Procedure
Results
Now the Query/Object/Object Text attribute is known as $1_Object Text and the condition can be processed correctly.