Configuration reference
Overview
Atoti What-If configuration is managed through properties with the atoti.what-if prefix. These properties can be set in application.yml or application.properties.
Property reference
General properties
| Property | Type | Default | Description |
|---|---|---|---|
atoti.what-if.enable |
boolean |
true |
Global toggle for all What-If features. Set to false to disable all What-If auto-configuration. |
Security properties
| Property | Type | Default | Description |
|---|---|---|---|
atoti.what-if.security.type |
NONE, SPRING, CUSTOM |
SPRING |
The type of security manager to use. |
atoti.what-if.security.use-branch-permissions |
boolean |
true |
Whether to use branch-level permissions. |
Security type options
| Value | Description |
|---|---|
SPRING |
Uses Spring Security context for user authentication and authorization. |
NONE |
No security checks are performed. All operations are allowed for all users. |
CUSTOM |
Provide your own IDatabaseSimulationsSecurityManager bean. |
Distribution properties
| Property | Type | Default | Description |
|---|---|---|---|
atoti.what-if.distribution.enabled |
boolean |
false |
Whether the application runs in distributed mode. |
atoti.what-if.distribution.query-node-name |
String |
"" |
The name of the query node. Required when distribution is enabled. |
atoti.what-if.distribution.create-distributed-service |
boolean |
true |
Whether to create the RestDistributedDatabaseService automatically. |
Configuration examples
Default configuration
No configuration is required for a standalone application with Spring Security:
# All defaults are applied automatically
Disable security
atoti:
what-if:
security:
type: none
Disable branch permissions
atoti:
what-if:
security:
type: spring
use-branch-permissions: false
Distributed mode
atoti:
what-if:
distribution:
enabled: true
query-node-name: "MyQueryNodeName"
Full configuration example
atoti:
what-if:
enable: true
security:
type: spring
use-branch-permissions: true
distribution:
enabled: false
query-node-name: ""
create-distributed-service: true
Required beans
The Spring Boot Starter requires two beans from your application:
IDatabaseService
Provided by your Atoti Server application. This bean is used by the simulation engine to execute database operations.
When distribution is enabled, a RestDistributedDatabaseService is automatically created to handle communication with data nodes. Set atoti.what-if.distribution.create-distributed-service to false if you want to provide your own distributed database service implementation.
IWhatIfPersistenceProperties
Provides Hibernate configuration for simulation persistence. The bean must return a Map<String, String> of Hibernate properties.
@Bean
public IWhatIfPersistenceProperties whatIfPersistenceProperties(
@Value("classpath:hibernate.properties") Resource resource) throws IOException {
Properties props = new Properties();
props.load(resource.getInputStream());
return () -> props.entrySet().stream()
.collect(Collectors.toMap(
e -> String.valueOf(e.getKey()),
e -> String.valueOf(e.getValue())
));
}
The starter uses these properties to create a SessionFactory bean (named whatIfSessionFactory). If you need more control over SessionFactory configuration (such as adding interceptors or event listeners), you can override the whatIfSessionFactory bean directly. See How to customize auto-configured beans for details.