> ## 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.

# Configuration reference

> Complete reference for all Atoti What-If configuration properties.

export const SpringPropertiesTable = () => {
  const [query, setQuery] = React.useState('');
  const [properties, setProperties] = React.useState([]);
  const [loading, setLoading] = React.useState(true);
  React.useEffect(() => {
    fetch('/data/limits-activeviam-metadata.json').then(r => r.json()).then(data => {
      setProperties(data.properties);
      setLoading(false);
    });
  }, []);
  const visible = query.trim() ? properties.filter(p => p.name.toLowerCase().includes(query.toLowerCase()) || p.description && p.description.toLowerCase().includes(query.toLowerCase())) : properties;
  if (loading) return <p>Loading properties…</p>;
  return <div>
      <input type="text" placeholder="Filter by name or description…" value={query} onChange={e => setQuery(e.target.value)} style={{
    marginBottom: '1rem',
    padding: '0.5rem 0.75rem',
    width: '100%',
    border: '1px solid var(--border)',
    borderRadius: '0.375rem'
  }} />
      <table style={{
    width: '100%',
    borderCollapse: 'collapse',
    fontSize: '0.875rem'
  }}>
        <thead>
          <tr>
            <th style={{
    textAlign: 'left',
    padding: '0.5rem',
    borderBottom: '2px solid var(--border)'
  }}>Name</th>
            <th style={{
    textAlign: 'left',
    padding: '0.5rem',
    borderBottom: '2px solid var(--border)'
  }}>Type</th>
            <th style={{
    textAlign: 'left',
    padding: '0.5rem',
    borderBottom: '2px solid var(--border)'
  }}>Default</th>
            <th style={{
    textAlign: 'left',
    padding: '0.5rem',
    borderBottom: '2px solid var(--border)'
  }}>Description</th>
          </tr>
        </thead>
        <tbody>
          {visible.map(prop => <tr key={prop.name} style={{
    borderBottom: '1px solid var(--border)'
  }}>
              <td style={{
    padding: '0.5rem',
    verticalAlign: 'top'
  }}>
                <code style={{
    fontSize: '0.8rem'
  }}>{prop.name}</code>
                {prop.deprecated && <span style={{
    marginLeft: '0.4rem',
    fontSize: '0.7rem',
    background: '#f59e0b22',
    color: '#b45309',
    border: '1px solid #f59e0b66',
    borderRadius: '0.25rem',
    padding: '0 0.3rem'
  }}>
                    deprecated
                  </span>}
              </td>
              <td style={{
    padding: '0.5rem',
    verticalAlign: 'top'
  }}>
                <code style={{
    fontSize: '0.8rem'
  }}>{prop.type}</code>
              </td>
              <td style={{
    padding: '0.5rem',
    verticalAlign: 'top'
  }}>
                {prop.defaultValue !== undefined ? <code style={{
    fontSize: '0.8rem'
  }}>
                      {Array.isArray(prop.defaultValue) ? prop.defaultValue.join(', ') : String(prop.defaultValue)}
                    </code> : <span style={{
    color: 'var(--muted)'
  }}>—</span>}
              </td>
              <td style={{
    padding: '0.5rem',
    verticalAlign: 'top'
  }}>{prop.description || '—'}</td>
            </tr>)}
        </tbody>
      </table>
      {visible.length === 0 && <p style={{
    textAlign: 'center',
    color: 'var(--muted)',
    marginTop: '1rem'
  }}>
          No properties match “{query}”
        </p>}
    </div>;
};

## 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:

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
# All defaults are applied automatically
```

### Disable security

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
atoti:
  what-if:
    security:
      type: none
```

### Disable branch permissions

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
atoti:
  what-if:
    security:
      type: spring
      use-branch-permissions: false
```

### Distributed mode

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
atoti:
  what-if:
    distribution:
      enabled: true
      query-node-name: "MyQueryNodeName"
```

### Full configuration example

```yaml theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
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.

```java theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
@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](./customize-beans#custom-sessionfactory) for details.

## Full generated reference

The table below is generated from the `@ConfigurationProperties` Java sources at build time, so it is always in sync with the code. Use it as the authoritative reference when the curated tables above don't cover a property.

<SpringPropertiesTable dataUrl="/data/properties/atoti-what-if-config/spring-configuration-metadata.json" />
