APL - PCC Mapper Support - Buckets (4.3)

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

ParameterDescription

area

The name of the area which the mapper is operating against.

typename

The fully qualified UDR typename to be used for the mapper configuration information.

argumentsField

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.

targetField

The field name of the field that contains the target value. This is the value that should be returned from the pccMapperGet function. This field is optional.

Returns:

A mapper object that can be used in pccMapperGet.

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

ParameterDescription

mapper

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.

argument...n

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

ParameterDescription

mapper

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.

argument...n

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

ParameterDescription

mapper

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.

argument...n

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

ParameterDescription

mapper

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.

index

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.