DML functions: Context

Context functions

getContextAttribute

setContextAttribute

removeContextAttribute

Context functions

In the Map Engine processes, context refers to the Map Engine environment. A context is represented by a list of attributes. These attributes, in turn, comprise key/value pairs.

An attribute persists between several runs of Map Engine execution. It exists until it is removed by the user.

After the Map Engine processes are stopped, the Map Engine sequentially records attributes on a persistent storage such as a disk file.

getContextAttribute

getContextAttribute Comment

Description

getContextAttribute returns the value of the specified context attribute.

Syntax

getContextAttribute(attribute_key)

Return

  • If attribute is found, string corresponding to the key value of the attribute is returned.
  • If no attribute is found, null is returned.

Parameters

attribute_key (String) : key of the attribute.

Example

getContextAttribute("Identifier"): returns the value of the attribute with the key "Identifier".

setContextAttribute

setContextAttribute Comment

Description

setContextAttribute sets the value of the specified context attribute. If the attribute does not exist, it is added to the list of attributes.

Syntax

setContextAttribute(attribute_key, attribute_value)

Return

setContextAttribute does not return a value.

Parameters

attribute_key (String) : key of the attribute.

attribute_value (String) : value of the attribute

Example

setContextAttribute("Identifier", "xxx"): sets the value of the attribute with the key "Identifier" to "xxx".

removeContextAttribute

removeContextAttribute Comment

Description

removeContextAttribute removes the specified context attribute.

Syntax

removeContextAttribute(attribute_key)

Return

removeContextAttribute does not return a value

Parameters

attribute_key (String) : key of the attribute

Example

removeContextAttribute("Identifier"): removes the attribute that contains the key "Identifier".

Related Links