15. External References Functions

externalReferenceGet

This function fetches an External Reference value (with value type as String) from an external source. For information about External References, see 8.11 External Reference Profile in the Desktop user's guide.

string externalReferenceGet (< ext ref profile >, < ext ref key >)

Note!

If you have a large number of external references, for example greater than 1000, this may impact the workflow startup and processing. It is therefore recommended that extraction is done using an APL configuration in multiple functions and that extraction is executed in the initialize block of an Analysis agent.

Example - With large number of external reverences

If you have a large number of external references, the APL configuration may look as shown below:

final string EXT_REF = "Default.PRF_ExtRef";
map<string, string> keyValueMap;

void loadStrings1(){

    keyValueMap = mapCreate(string, string);
    mapSet(keyValueMap, "EXT_VAL1", externalReferenceGet(EXT_REF, "EXT_VAL1"));
    mapSet(keyValueMap, "EXT_VAL2", externalReferenceGet(EXT_REF, "EXT_VAL2"));
    mapSet(keyValueMap, "EXT_VAL3", externalReferenceGet(EXT_REF, "EXT_VAL3"));
    mapSet(keyValueMap, "EXT_VAL4", externalReferenceGet(EXT_REF, "EXT_VAL4"));
    mapSet(keyValueMap, "EXT_VAL5", externalReferenceGet(EXT_REF, "EXT_VAL5"));
    ...
}
 
void loadStrings1000(){

    keyValueMap = mapCreate(string, string);
    mapSet(keyValueMap, "EXT_VAL1001", externalReferenceGet(EXT_REF, "EXT_VAL1001"));
    mapSet(keyValueMap, "EXT_VAL1002", externalReferenceGet(EXT_REF, "EXT_VAL1002"));
    mapSet(keyValueMap, "EXT_VAL1003", externalReferenceGet(EXT_REF, "EXT_VAL1003"));
    mapSet(keyValueMap, "EXT_VAL1004", externalReferenceGet(EXT_REF, "EXT_VAL1004"));
    mapSet(keyValueMap, "EXT_VAL1005", externalReferenceGet(EXT_REF, "EXT_VAL1005"));
    ...
}

It is recommended that you configure an Analysis agent so that extraction is done in the initialize block only extracting the required references for the specific agent, as shown below:

import apl.Default.extreflib1;

initialize{
   loadStrings1(); 
}

consume {
...

}
ParameterDescription

ext ref profile:

The External Reference Profile

ext ref key:

The External Reference key

Note!

The key must have Value type as String in the profile.

Returns

The External Reference value

Note!

To convert the returned value type from string to another data type, use one of the APL string conversion commands. For further information see 2.8 Type Conversion Functions

externalReferenceGetList

This function fetches an External Reference value (with value type as List) from an external source. For information about External References, see 8.11 External Reference Profile in the Desktop user's guide.

list<any> externalReferenceGetList (< ext ref profile >, < ext ref key >)
ParameterDescription

ext ref profile:

The External Reference profile

ext ref key:

The External Reference key

Note!

The key must have Value type as List in the profile

Returns

A list of External Reference values

externalReferenceGetMap

This function fetches an External Reference value (with value type as Map) from an external source. For information about External References, see 8.11 External Reference Profile in the Desktop user's guide.

map<string, any> externalReferenceGetMap (< ext ref profile >, < ext ref key >)
ParameterDescription

ext ref profile:

The External Reference profile

ext ref key:

The External Reference key

Note!

The key must have Value type as Map in the profile.

Returns

A map of External Reference key/value pairs