Using the User Data Map

The application development framework provides a map of name/value pairs that is associated with the current user's session. You can use this map to temporarily save name/value pairs for use by your business logic.

Be aware that the information that you put in the user data map is never written out to a permanent store, and is not replicated under failover conditions. If the code reading a user data map key executes as part of different web request from the code that put the value in the map, then write the code in a resilient way to correctly handle the situation when the expected value is not present due to server failover.

To access the server map from a validation rule or trigger, use the expression adf.userSession.userData as shown in the following example:

// Put a name/value pair in the user data map
adf.userSession.userData.put('SomeKey', someValue)

// Get a value by key from the user data map
def val = adf.userSession.userData.SomeKey
Tip: See Using Groovy Maps and Lists with Web Services for more information on using maps in your scripts.