Create custom conditions to use with word replacement pairs. You have a lot of flexibility, so make sure that the conditions you create make sense and work correctly.
Each condition includes a defined function and possible user-defined values. For example, the user must specify at least one value, such as Argentina, when defining a word pair with the seeded If Country Equals condition. If the record being evaluated has Argentina as the Country attribute, then the word replacement occurs.
On the other hand, the seeded End of String condition and does not require a user-defined value. If the original word is at the end of a string and the replacement word does not cause the entire string to be null, then the word replacement occurs.
Write a custom function with this signature:
FUNCTION <custom function>(
p_input_str IN VARCHAR2,
p_token_str IN VARCHAR2,
p_condition_id IN NUMBER,
p_condition_val IN VARCHAR2)
RETURN BOOLEAN;
The tca_eval_condition_rec function is used for all seeded conditions. Instead of defining a new function, you can use the seeded one and write custom code in the if/elseif block for the condition_id, as shown in this example:
IS
BEGIN
if condition_id = 1
get_gbl_condition_rec_value( 'PARTY_SITES', 'COUNTRY' ) = 'US'
do this and return true/false ;
elsif condition_id = 2
get_gbl_condition_rec_value( 'PARTY_SITES', 'ZIPCODE' ) = 'xxxxxx'
do this and return true/false ;
else
return true ;
END ;
Insert a new row in the HZ_WORD_RPL_CONDS_B table and populate the columns.
CONDITION_FUNCTION: The custom function that you define for the condition.
CONDITION_VAL_FORMAT: How many user-defined values the condition can take. This table provides examples of how the possible column values are used.
| CONDITION_VAL_FORMAT Value | Condition | Reason |
|---|---|---|
| None | Start of String | Condition does not apply to specific values |
| Single | Party Type Equals | Condition requires only one party type value |
| Multiple | In Country | Condition requires at least one country value |
Note: It is possible to implement a condition that applies to multiple attributes, for example a Party Type Equals and In Country condition. Single attribute conditions, however, are recommended.