How to enter a Java identifier

To type a Java identifier into a PRPC rule form, user form, or other form:

Background

PRPC uses Java identifiers in generated Java code. Java identifiers in PRPC are identical to true Java language identifiers, except that Java identifiers that are parts of a key to an object are limited to 128 characters, or less in specific cases.

Where you need Java identifiers

These features require Java identifiers:

1. A key part of rules of many rule types must be a valid Java identifier. This requirement applies to all rule types for which View Java is visible from the Actions menu, including:

Activities (Rule-Obj-Activity)

Collections (Rule-Declare-Collection)

Connect rules (Rule-Connect-*)

Data transform rules (Rule-Obj-Model)

Edit input rules (Rule-Edit-Input)

Edit validate rules (Rule-Edit-Validate)

Rule types derived from Rule-Stream, including HTML, HTML fragment, XML, Harness, Section, Property, Paragraph and Flow Action

Function rules (Rule-Utility-Function)

Libraries (Rule-Utility-Library)

Map values (Rule-Obj-MapValue)

Sections (Rule-HTML-Section)

Service rules (Rule-Service-*)

2. For Value Group and Page Group properties, each subscript value must be valid Java identifiers. The following are acceptable:

StateCapital("VT")
ZipCode(Customer)
Domaine(EntreDeuxMers2005)

The quotes are optional.

NoteYou can't use a value that starts with a digit as a Value Group or Page Group subscript. The following are not correct, where the property is a Value Group or Page Group.

StateCapital(8)
ZipCode(02138)
Domaine(4X4)

3. In activities, the names of parameters and local variables must be valid Java identifiers.

5. In flows, list value rules, summary value rules, and sections, the names of parameters must be valid Java identifiers.

In some cases, PRPC may accept other formats, but follow these guidelines to avoid problems. Internally, PRPC converts any characters other than letters and digits in these fields to an underscore character; this can cause unintended duplicates.

Property values

To restrict a Single Value property to hold only Java identifier values:

Standard function

In an expression, call the standard function rule ValidateJavaIdentifier( ) to test whether a property contains a valid Java identifier.

Related topics Choosing good rule and data instance names

UpTechnical category