The Prefix Switching Comparator component compares a string property with prefixes of string type.
When you insert it in the decision tree, the Prefix Switching Comparator component creates:
A branch for each prefix, the branch of which is activated if the string property matches the related prefix.
An additional branch that is activated if the string property does not match a prefix.
|
Note: When several prefixes contain identical characters, the Prefix Switching Comparator selects the prefix which contains the most characters in common with the string property. |
When the component is executed, only one branch is activated depending on the test result.
In a price plan, If you want to apply different prices to branches, you may need to compare a property with a set of prefixes. To use the Prefix Switching Comparator inside your price plan, do the following:
After you add the component, choose the property and the prefixes.
Describe the pricing of each decision tree branch by using a Function component.
An operator applies different prices to phone calls depending on the called number. The operator want to determine the price for one minute of call time by analyzing the prefix of the called number. Using the Prefix Switching Comparator component, the operator needs to create a numerical property "called number" and compares it with other prefixes. The following table presents the information that the operator needs to set up the Prefix Switching Comparator component inside the price plan:
|
Data |
Settings |
|
Property |
Called number |
|
Prefix P1 |
02 |
|
Prefix P2 |
06 |
|
Prefix P3 |
089 |
|
Pricing rules |
P1 Branch: $0.17 per minute. P2 Branch: $0.34 per minute. P3 Branch: $0.06 per minute. “Other prefix” branch: $0.25 per minute. |
Name: Type the name of the component (mandatory).
Description: Allows you to type the description of the component (optional).
Property Name: Provides the list of string properties. Select a string property.
Prefixes: Each row in the table represents a prefix to be compared with the property. Each prefix row also represents a branch in the decision tree. Once you have added a row to the table, double-click the row, and then type a prefix.
: Adds a row to the table. Click the button to add a prefix row to the table.
: Deletes a row from the table. To remove a prefix, select the corresponding prefix row, and then click this button.
: Moves a row up in the table. To move a prefix up, select the corresponding prefix row, and then click this button.
: Moves a row down in the table. To move a prefix down, select the corresponding prefix row, and then click this button.
: Opens the Open dialog box to search for a file and import data into the table. Click this button when you want to create prefixes with data from a CSV file instead of manually entering data.
: Deletes all the rows in the table. Click this button to delete the list of prefixes.