To define the relationships between a set of properties and a single structured text value, create a Map Structured rule.
- In the header of Dev Studio, click .
- On the Map Structured Record Configuration page, in the Label field, enter an identifier for this rule.
- In the Context section, in the Apply to field, select the class to which this rule applies.
- Click Create and open.
Result: The Map Structured rule form opens on the Mapping tab.
- On the Mapping tab, in the Settings
section, in the Character encoding field, select an option to
control the character set used in the output structure when you use this rule in the From
Clipboard direction to write to an output file. Select Default to use the character set of your Pega Platform server, or another character set such as ASCII, Windows Latin-1, or UTF-8.
Character conversion from the internal character set of your Pega Platform server to the encoding you specify in this field occurs only when you use this rule with the Connect-File method; the Map-Structured method ignores this field.
Character conversion uses standard Java methods; in some cases two-byte characters may be converted to single-byte output characters.
- In the Justification field, select Left
or Right to control the justification of data within the field when
the field length is longer than the data and you use this rule in the From Clipboard
direction to assemble structure.
For example: When you specify Left, padding only occurs in remaining character positions (if any) after the end.
- In the Default pad character field, indicate the type of
character you want to use to pad your data when you use this rule in the From Clipboard
direction to assemble a structure.When you use a map structured rule in the To Clipboard direction to disassemble a structure, no padding occurs.
- If you want to pad your data with spaces, select Space.
- If you want to pad your data with another type of character, select Other.
- If you select Other in step 7, in the
Specify pad character field, enter a single character that you
want to use to pad your data.
Note: You can override this choice at the individual field level. You cannot enter an octal, decimal, or hex representation of a character in this field.
- In the Map format field, identify the size and position of each
field in the data structure.When you save the Map Structured form, the system validates that no fields are overlapping, and presents a warning if there are gaps (unmapped character positions) between fields.
- In the Offset field, enter a number for the character offset
from the beginning of the structure for the first character position of this field. The first character of the structure starts at offset 0.
- In the Length field, enter a number for the length in
characters.At run time, when this rule is used in the From Clipboard direction, the system truncates data values longer than this length, and pads data values shorter than this length.
- In the Property field, enter a property reference. To
reference a property on the page corresponding to the Applies To key part, enter a
period and the property reference. Use the notation
pagename.propertyname to reference a property on another page,
and include that page name on the Pages & Classes
tab.As a best practice, enter only properties that have a character-oriented type, such as Text, Date, DateTime, Identifier, Time of Day, or Decimal. Do not use Double, TrueFalse, Integer, or Password properties.
You can also enter a string constant, by surrounding the text with quotation marks, or an expression. String constants and expressions are used to construct a string when the Map From Property to Clipboard direction is selected in the Map-Structured method.
For more information about expressions, see About Expressions.
- To control padding when you use this rule in the From
Clipboard direction to assemble a structure, in the Pad
character field, enter a character value. Leave this field blank to use
the pad character specified as the default.
Note: You cannot use an octal, decimal, or hex representation of a character in this field.
- To control justification of the value within the structured value when you use this rule in the From Clipboard direction, in the Justification field, choose Default to use the value in the Justification field in the Settings section, tor Left or Right.
- In the Offset field, enter a number for the character offset from the beginning of the structure for the first character position of this field.
- Click Save.