Use the lookup tag to retrieve and display:
The syntax allowed for these two options differs, so they are explained separately below.
The lookup tag does not require the object that contains the value to be present on the clipboard.
To display a property value for an object without opening the object, first determine the following:
Here is an example, explained in detail below.
<pega:lookup className="Rule-Obj-HTML" property="pxCreateOperator">
<pega:key name="pyClassName" value="Work-" />
<pega:key name="pyStreamName" value="Newbook" />
</pega:lookup>
The pega:key
tags are embedded in the body of the pega:lookup
tag. The pega:key
tag specifies the name for each key part of the instance.
To learn which properties form the key of any concrete class, review the Basics tab of a Class form. If the KEYS array is empty, review the Basics tab of the parent class rule or the associated class group data instance.
The property
and className
attributes are required.
Attribute |
Value |
||||||||||||||||||||||||||
property
|
Name of the property (second key part) |
||||||||||||||||||||||||||
className
|
Class of the property (Applies To key part) |
||||||||||||||||||||||||||
formatOutput
|
Optional. Set Omit this attribute or set This attribute is not available when the lookup tag is used to retrieve a field value rule. |
||||||||||||||||||||||||||
mode |
Optional. Values are mode=normal Use
mode=literal Use mode="literal" to prevent any HTML encoding. The special characters listed in the table above are passed through unchanged during stream processing. mode=javascript Setting Six characters are escaped:
|
||||||||||||||||||||||||||
useCache |
Optional. For database lookups, the retrieved value is ordinarily retained in a temporary clipboard page, similar to the approach used for linked properties. (Such pages are deleted upon the next Commit operation in the Thread.) This caching improves performance, by eliminating a database fetch operation if the same value is needed a little later. However, it can result in the display of stale data, or the use of stale data in a calculation or decision. You can use either of two approaches to prevent this caching: |
Include a key tag that identifies a value for each key part. The name attributes is required. Either the value or ref attribute is required.
To learn which properties form the key of any concrete class, review the Basics tab of a Class form. If the KEYS array is empty, review the Basics tab of the parent class rule.
Attribute |
Value |
name
|
Property that forms part of the key. |
value
|
Value of that key part. |
ref | Expression that computes the value of that key part. |
Examples:
<pega:key name=”KeyProperty” ref=”.SomeValue” />
<pega:key name=”KeyProperty” ref=”Param.SomeParameter” />
<pega:key name=”KeyProperty” ref=”$save(Something)” />
To display the Add Operator field for an HTML rule instance named Work-.Newbook without opening the instance to the clipboard:
The result:
<pega:lookup className="Rule-Obj-HTML" property="pxCreateOperator" >
<pega:key name="pyClassName" value="Work-" />
<pega:key name="pyStreamName" value="Newbook" />
</pega:lookup>
The lookup tag can be used within other tags, to supply values used as HTML attribute values and in XML tags.
If the property Table Type is not None and the Use for display (not validation)? check box is selected, the output is translated according to the table contents. This can provide one approach to localization of the value.
Using information in the General tab and field value rules for a property, you can use the lookup tag to convert a Single Value
property text value from English (or another base language) to a locale-specific value.
To construct the localized values:
Field Value
as the Table Type on the General tab of the property.
Attribute |
Value |
||||||||||||||||||||||||||
property
|
Reference to a property, in the context of the current stream rule. |
||||||||||||||||||||||||||
value
|
Optional. English value of the field, if a known constant value. |
||||||||||||||||||||||||||
formatOutput
|
Optional. Set Omit this attribute or set |
||||||||||||||||||||||||||
mode |
Optional. Values are mode=normal Use
mode=literal Use mode="literal" to prevent any HTML encoding. The special characters listed in the table above are passed through unchanged during stream processing. mode=javascript Note: Setting
|
During stream processing, the system uses the user's locale to access the localization ruleset. The output is the contents of the Localized Label field.
The text "No data available" appears when:
The General tab of the standard property @baseclass.pyCaption indicates that values are defined by field value rules:
Hundreds of standard field value rule define text values for the property pyCaption. The field value rule @baseclass.pyCaption.City in the Pega-ProCom ruleset contains an English text value "City"; the same value in the language-specific ruleset ALPHA_FR (for French-speaking locales) can have a Localized Label of "Ville". The JSP tag is:
<pega:lookup property=".pyCaption" value="City" />
An application contains a property Order.BoxColor in ruleset ALPHA. In the English base application, values of this property are "red", "yellow", "magenta", and so on.
To support Italian-speaking application users, the developers add a localization ruleset named ALPHA_it_IT. To support French-speaking users, another localization ruleset named ALPHA_it_FR is created.
Two sets of field value rules are created, one for each color value in each ruleset. For example, each ruleset can contain rules with these key parts:
Order.BoxColor.red
Order.BoxColor.yellow
and so on. The Localized Label of the first field value rule contains rosso for the ALPHA_it_IT ruleset and rouge for the ALPHA_fr_FR ruleset.
The JSP tag is:
<pega:lookup property=".BoxColor" formatOutput="false" />
For users working with a locale setting of it_IT, stream processing produces "rosso" when Order.BoxColor is red. Users with a locale setting of fr_FR see "rouge."
The optional Dynamic System Setting prconfig/useUdfToRetrievePropertyValue/database
can improve performance of the lookup JSP tag when the target property is not an exposed database column in the PegaRULES database.
Note: By default, the value of this Dynamic System Setting is false. As a best practice, define this setting and set it to "true".
When this setting is true, property values retrieved by the lookup JSP tag are saved temporarily on a special clipboard page, visible in the Linked Properties page grouping of the Clipboard tool. Such pages are deleted upon the next Commit operation by the requestor Thread; this reduces the likelihood of stale values.