> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up context values

> Guide to setting up default context values in Atoti FRTB using the Reference Implementation

This page provides a description of how the default context values are set up.

The techniques employed are generic examples that can be extended, adapted and
repeated for any use case. In all cases, minimal changes are made to the Reference Implementation.

For more information about context values please see the Atoti Server documentation: [Context Values](https://docs.activeviam.com/engine/java-sdk/6.1/cube/context_values.md).

## Data Cube Context Values

The context values are defined in the configuration class `ContextValueConfig` within `frtb-starter/src/main/java/com/activeviam/frtb/starter/cfg/impl` as
separate beans for each cube. The following table lists the bean defined for each data cube.

| Cube | Bean name |
| - | - |
| StandardisedApproachCube | contextValueStandardisedApproachCube |
| InternalModelApproachCube | contextValueInternalModelApproachCube |
| IMADRCCube | contextValueIMADRCCube |
| PLCube | contextValuePLCube |
| StressedCalibrationCube | contextValueStressedCalibrationCube |
| FRTBCombinedCube | contextValueFRTBCombinedCube |

## Query Cube Context Values

In a distributed deployment, query cubes use the same context value beans as their corresponding data cubes.

| Query Cube | Uses Bean from |
| - | - |
| SAQueryCube | contextValueStandardisedApproachCube |
| IMAQueryCube | contextValueInternalModelApproachCube |
| IMADRCQueryCube | contextValueIMADRCCube |
| PLQueryCube | contextValuePLCube |
| StressCalibrationQueryCube | contextValueStressedCalibrationCube |

## Example

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
@Bean
public List<IContextValue> contextValuePLCube(@Value("${" + CTX_QUERIES_TIME_LIMIT_DATA + ":300}") int queriesTimeLimit,
    @Value("${" + CTX_QUERIES_RESULT_LIMIT_INTERMEDIATE_SIZE + ":" + DEFAULT_INTERMEDIATE_LIMIT + "}") int queriesResultLimitIntermediateSize,
    @Value("${" + CTX_QUERIES_RESULT_LIMIT_TRANSIENT_SIZE + ":" + DEFAULT_TRANSIENT_LIMIT + "}") long queriesResultLimitTransientSize,
    @Value("${" + CTX_BACK_TESTING_LOOKBACK + ":250}") String backTesting,
    @Value("${" + CTX_PLA_LOOKBACK + ":250}") String plaLookBack
){
	return List.of(
		QueriesTimeLimit.of(queriesTimeLimit,TimeUnit.SECONDS),
		[...]
	);
}
```
