Defining Elements of a Pattern Role
When creating a pattern role, you need to define several elements, which are described in the following sections.
Pattern Roles General Tab
The General tab enables you to specify elements for defining a role in your pattern.
Figure 8-11 Pattern Roles Dialog Box—General Tab

The Pattern Roles General tab contains the following elements:
- Pattern Roles grid: Lists all roles defined for a rule scenario.
- Variable: Enables you to select the variables you want to save to the KDD_BREAK_BINDING table. Clicking the column header orders the list of roles alphabetically by variable name.
- Description: Enables you to specify any additional information to include in a role. Clicking the column header orders the list of roles alphabetically by description.
- Format: Enables you to select the desired format and to define whether or not to display the specified variable. If you select the <NOT DISPLAYED> option in the drop-down list, the variable does not display in the Web Application.
- TA Role Use: Enables you to specify if a pattern role variable should be available for the threshold analyzer role in Threshold Analyzer Roles dialog box. By default, the TA Role Use check box is clear.
- Add: Saves the specified pattern role information.
- Modify: Applies changes to a pattern role.
- Delete: Deletes a pattern role. Clicking the Delete button removes the variable from the KDD_PT- TRN_ROLE table, and the associated variable from the KDD_TA_ROLES table on the condition that no other patterns for a scenario should have a pattern role record for that particular variable.
- Move Up: Changes the order of a role by moving the selected role up.
- Move Down: Changes the order of a role by moving the selected role down.
- OK: Saves, changes, and closes the dialog box.
- Cancel: Cancels any changes and retains the previously saved role information.
The following table defines the most commonly used pattern role format
                field options.
                     
                        
                           
                              
                     
                  
                  
                  Table 8-4 Pattern Role Format Field Options
| Format Option | Description | 
|---|---|
| <NOT DISPLAYED> | Does not display the variable in the Web Application, when selected. | 
| STRING | Does not apply formatting to the value returned from the database. This format is also useful for numbers that should not have thousands separators, for example, numeric account numbers. | 
| INTEGER | Applies thousands separators to whole numbers. | 
| REAL2 | Applies thousands separators to real numbers, truncating to two digits of fractional data. | 
| REAL5 | Applies thousands separators to real numbers, truncating to five digits of fractional data. | 
| $.00 | Applies thousands separators and a currency symbol, for example,$, to a number. Fractions are displayed. For example, a positive number displays as $1,234.56 and a negative number displays as ($1,234.56). | 
| $ | Applies thousands separators and a currency symbol to a number. Fractions are rounded to the nearest whole number. For example, positive numbers display as $1,234 and negative numbers display as($1,234). | 
| $K | Applies thousands separators and a currency symbol to a number. Fractions are rounded to the nearest whole number. If the number is 1,000,000 or greater, the number is rounded to the nearest thousand, and the final three digits are replaced with the letter “K.” For example, positive numbers display as $1,234 or $2,346K for $2,345678.90 and negative numbers display as ($1,234) or ($2,346K) for -$2,345678.90. | 
| CURRENCY | Applies the appropriate currency format (including base currency) to a value. | 
| MMDDYY | Displays the short form of the date (for example, 05/18/04). | 
| MMDDYYYY | Displays the long form of the date (for example, 05/18/2004). | 
| DATETIME | Displays the short date format and time format in the 24-hour clock(for example, 05/18/04 23:59:59). | 
| HHMMSS | Displays the long time in 24-hour format. The expected input is an integer that represents a number of seconds. For example, 93599 seconds is displayed as 25:59:59. | 
| % | Displays the data as a percentage. | 
| ALT_CUR | Used for cases where all highlights/roles are of
                                    the same currency, but NOT base currency. The format for the
                                    amount(s) should be ALT_CUR. Then, the
                                    scenarios will record an additional binding with binding nameAlt_Currency_Codethat holds the currency
                                    code. The highlights generator would then/take find the value
                                    from theAlt_Currency_Codebinding and use it
                                    to format all of the bindings with format ALT_CUR. For example:
                                        OrderPrice role with formatALT_CURandAlt_Currency_Codebinding with value as
                                    ISSUE_CRNCY_CD from pattern, let's say value is EUR. Thus
                                        OrderPrice will be displayed as xxx EUR. Here xxx is
                                    the value coming from pattern. | 
| REF_CUR | Used for cases where all highlights/roles are
                                    not of the same currency (including base currency) or different
                                    bindings having different currencies to display, use a format
                                    code REF_CUR for the amount, and then have an additional binding
                                    with the same name, but with _CUR on the end and contain the
                                    currency to be used. For example, define TradePrice and
                                        ActivityPrice roles with format REF_CURandTradePrice_CUR, andActivityPrice_CURbinding to hold the
                                    Currency to be used for the above, say EUR and USD respectively.
                                    Thus they will be displayed as TradePrice: xxx EUR &
                                        ActivityPrice : zzz USD.Here xxx and zzz are the values
                                    coming from pattern. | 
| HHMMSS_PT | Displays the long Time format in 24-hour clock with milliseconds precision. For example, the display of 103001500 will be as 10:30:01:500 | 
To define elements of a pattern role, follow these steps:
- From the Windows menu of the DataSet Editor, select
                        Rule Patterns.
                        The Rule Scenario Editor window displays. 
- From the scenario navigation tree area, navigate to the desired pattern element.
- 3. In the Pattern area, click Edit Roles.
                        The Pattern Roles dialog box displays. 
- Select the desired variable from the Variable drop-down list.
- Type the text you want associated with this role in the Description field.
- Click the arrow of the Format drop-down list to identify the highlights from other pattern roles, and to define the display of the pattern roles on the Web Application pages (refer to above table for details about the options for this field).
- Select the TA Role Use check box if you want to assign pattern role variable to a threshold analyzer role.
- Click Ok.