Skip to main content

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.

Components of the Atoti What-If library

ComponentDescription
IUniqueIdGeneratorInterface for the creation of unique ID generators.
IncrementalUniqueIdGeneratorImplementation of IUniqueIdGenerator which uses an incremental counter starting from the Epoch second.
DatabaseSimulationEngineInternal component wrapping interactions with an IDatabaseService.
ISimulationPersistenceManagerInterface for CRUD operations on a persistence layer for simulations.
HibernateSimulationPersistenceManagerAn implementation of ISimulationPersistenceManager using Hibernate for persistence in a database.
IDatabaseSimulationsWorkflowInterface for a component handling the creation, execution, retrieval and deletion of simulations within an application server.
IDatabaseSimulationsSecurityManagerInterface for a component handling branch permissions related to simulations.
SpringDatabaseSimulationsSecurityManagerAn implementation of IDatabaseSimulationsSecurityManager matching Spring authentication against Atoti Server user roles.
NoOpDatabaseSimulationsSecurityManagerAn implementation of IDatabaseSimulationsSecurityManager that ignores the user attempting to execute simulations.
DatabaseSimulationsWorkflowImplementation of IDatabaseSimulationsWorkflow using DatabaseSimulationEngine, ISimulationPersistenceManager, IDatabaseSimulationsSecurityManager, IUniqueIdGenerator and IDatabaseService objects to orchestrate the execution of database simulations.
ArithmeticUpdateProcedureFactoryImplementation of IUpdateWhereProcedureFactory for update-where procedures that apply an arithmetic operation to a table field.
UpdateWithFieldValuesProcedureFactoryImplementation of IUpdateWhereProcedureFactory for update-where procedures that accepts a map of field names and associated objects.
UpdateWithListOfValuesProcedureFactoryImplementation of IUpdateWhereProcedureFactory for update-where procedures that accepts a set of keys and updated rows as a list of value maps.
IDatabaseSimulationDefinitionInterface for the definition of simulations, an extension of IExtendedPluginValue with methods for retrieving definition parameters, the description, the list of changes made by the simulation and a JsonDatabaseEdit object to use with the IDatabaseService.
ADatabaseSimulationDefinitionA serializable abstract implementation of IDatabaseSimulationDefinition that converts the parameters map to a string map, and wraps an array of JsonDatabaseAction objects in a JsonDatabaseEdit.
DatabaseSimulationDefinitionDTOA DTO for the type, parameters and description of a database simulation definition.
DatabaseSimulationDiffDTOA DTO for the before/after values resulting from executing a simulation.
IDatabaseSimulationInterface for simulations, with methods for retrieving information about a specific instance of a simulation.
DatabaseSimulationA serializable implementation of IDatabaseSimulation.
DatabaseSimulationDTOA DTO for the relevant information associated with a database simulation.
DatabaseSimulationsUtilsA utility class containing helper methods for the creation of JsonDatabaseAction objects, the creation of duplicate tuples and conversions to and from a JsonNode.

Auto-configuration

When using the Spring Boot Starter, the following beans are created automatically. All auto-configuration classes are gated by @ConditionalOnWhatIfEnabled, so setting atoti.what-if.enable: false disables all of them.
BeanAuto-configuration classCondition
DatabaseSimulationEngineWhatIfCoreConfigAlways
IUniqueIdGeneratorWhatIfCoreConfigAlways
ISimulationPersistenceManagerWhatIfPersistenceConfigIWhatIfPersistenceProperties bean present
IDatabaseSimulationsSecurityManagerWhatIfSecurityConfigBased on security.type property
IDatabaseSimulationsWorkflowWhatIfWorkflowConfigAlways
DatabaseSimulationsRestServiceWhatIfRestConfigWeb application context
IDistributedQueryResultsMergerWhatIfDistributionConfigdistribution.enabled: true
RestDistributedDatabaseServiceWhatIfDistributionConfigdistribution.enabled: true and distribution.create-distributed-service: true

Auto-configuration classes

ClassDescription
WhatIfCoreConfigCreates the simulation engine and ID generator.
WhatIfPersistenceConfigCreates the Hibernate-based persistence manager.
WhatIfSecurityConfigCreates the security manager based on the configured type.
WhatIfWorkflowConfigCreates the simulation workflow.
WhatIfRestConfigCreates the REST service for UI interactions.
WhatIfDistributionConfigCreates beans for distributed mode.

How to override auto-configured beans

All auto-configured beans use @ConditionalOnMissingBean, meaning your custom beans take precedence. Define a bean of the same type in your configuration:
@Bean
public IUniqueIdGenerator customIdGenerator() {
    return new MyCustomIdGenerator();
}
See How to customize auto-configured beans for more details and examples.

Simulation and definition objects

In previous versions of Atoti What-If, definitions contained concrete parameters and abstract methods that directly operate on a datastore. Version 2.0 allows for free-form serializable parameters and methods that build objects to be passed to the IDatastoreInstance. The results of the simulation (diffs) are also omitted from the persistence of the simulations. They are now an optional implementation detail for definitions that require them. DTOs are also provided for both object types, that is, for serialization and REST service implementations.