APL - PCC Mapper Support - Buckets (4.0)
The mapper support is used for accessing a table in the products database containing references to the products that are applicable for the specified service.
The mapper support functions include:
Note!
These functions can be used to create and use a PCC flexible mapper object.
pccMapperCreate
This function creates a mapper object.
any pccMapperCreate ( string area , string typename [, string argumentsField , string targetField ] )Â
Parameters
Parameter | Description |
---|---|
| The name of the area which the mapper is operating against. |
| The fully qualified UDR typename to be used for the mapper configuration information. |
| The field name of the field that contains the argument list to be used for matching. This field must be a list of strings. Either null or the string "*" can be used to signify a wildcard matching. This field is optional. |
| The field name of the field that contains the target value. This is the value that should be returned from the |
Returns: | A mapper object that can be used in |
Example
productMapping = pccMapperCreate ("PROD", "PCC.Products.Provisioning.ProductMapping");
will create a mapper object named productMapping that will use the PCC.Products.Provisioning.ProductMapping UDR type and operate against the PROD area.
pccMapperGet
This function will return a list of matching targets from PCC mapper objects, where the targets will be returned in priority order.
list<any> pccMapperGet ( [any mapper,] any argument1 [, any argument2, ... )Â
Parameters
Parameter | Description |
---|---|
| The mapper table in which you want to find matching targets. This field is optional. If no mapper is stated, the mapper last used by the workflow will be used for the lookup. |
| Any number of arguments that you want the targets to match to match using the mapper object. The number of arguments must match the mapper configuration. |
Returns: | A list with the matching target(s), or null if the mapper did not find any matching targets. |
Example
list<any> myList = pccMapperGet(productMapping, 55)
will return targets matching argument 55 in the productMapping mapper object.
If there are five targets with the same priority; A, B, C, D, and E, and D and E matches argument 55, a list containing [D,E] will be returned.
If there are three targets with priority 2; A, B, C, and three targets with priority 1; D, E and F, and targets B-E matches argument 55, a list containing lists for each priority will be returned displaying the matches in priority order; [[D,E],[B,C]].
pccMapperGetFlat
This function will return a list of matching targets from PCC mapper objects, where the priority is not taken into consideration.
list<any> pccMapperGetFlat ( [any mapper,] any argument1 [, any argument2, ... )Â
Parameters
Parameter | Description |
---|---|
| The mapper table in which you want to find matching targets. This field is optional. If no mapper is stated, the mapper last used by the workflow will be used for the lookup. |
| Any number of arguments that you want the targets to match to match using the mapper object. The number of arguments must match the mapper configuration. |
Returns: | A list with the matching target(s), or null if the mapper did not find any matching targets. |
Example
list<any> myList = pccMapperGetFlat(productMapping, 34);
will return a list of the products named "GOLD" using the mapper table productMapping.
No consideration is taken to priority, which means that if there are three targets with priority 2; A, B, C, and three targets with priority 1; D, E and F, and targets B-E matches argument 34, a single list containing all matching targets will be returned; [D,E,B,C].
pccMapperGetIndex
This function will provide a list of all matching products with an index for each matching. This index may then be used by the pccMapperGetFromIndex
function below for retrieving the products applicable for the actual object.
list<any> pccMapperGetIndex ( [any mapper,] any argument1 [, any argument2, ... )
Parameters
Parameter | Description |
---|---|
| The mapper object to be used for matching the arguments. This field is optional. If no mapper is stated, the mapper last used by the workflow will be used for the lookup. |
| Any number of arguments to match using the mapper object. The number of arguments must match the mapper configuration. |
Returns: | A list of the matching products with an index for each matching object, or null if the mapper did not match any data. |
Example
list pccMapperGetIndex(productMapping,"GOLD");
will return a list of the products named "GOLD" using the mapper table productMapping , with an index for each matching object.
pccMapperGetFromIndex
This function will provide a list of products applicable for the stated object.
list<any> pccMapperGetFromIndex ( any mapper,] int index )
Parameters
Parameter | Description |
---|---|
| The mapper object to be used for matching the arguments. This field is optional. If no mapper is stated, the mapper last used by the workflow will be used for the lookup. |
| The index for the object that you want to retrieve products for. |
Returns: | A list of products applicable for the object with the stated index. |