Migrate 4.0.4-AS6.1 to 4.1.0-AS6.1

Migrate from Atoti What-If 4.0.4-AS6.1 to 4.1.0-AS6.1. Consult the Atoti What-If 4.1.0-AS6.1 release notes and changelog for a complete view of changes.

  1. Back up your project.
  2. Update the Atoti What-If dependency.
  3. Upgrade your security manager.
  4. Update your external database schema (only required if using an external database).
  5. Confirm successful build and startup.

Update dependencies

pom.xml

Update Atoti Server to 6.1.11

info

Atoti What-If 4.1.0-AS6.1 is shipped with 6.1.11, but you can use later versions if they are available.

Update Atoti What-If to version 4.1.0-AS6.1

You can upgrade Atoti What-If in your project from 4.0.4-AS6.1 to 4.1.0-AS6.1 by making the following change:

  • Atoti What-If 4.0.4-AS6.1:
<dependency>
    <groupId>com.activeviam.apps</groupId>
    <artifactId>whatif</artifactId>
    <version>4.0.4-AS6.1</version>
</dependency>
  • Atoti What-If 4.1.0-AS6.1:
<dependency>
    <groupId>com.activeviam.apps</groupId>
    <artifactId>whatif</artifactId>
    <version>4.1.0-AS6.1</version>
</dependency>

Upgrade your security manager

Atoti What-If 4.1.0-AS6.1 improves user authorization for simulation and branch management. To achieve this, this release introduces several changes to the IDatabaseSimulationsSecurityManager and its SpringDatabaseSimulationsSecurityManager implementation.

If you are using the provided SpringDatabaseSimulationsSecurityManager implementation, update your configuration from

  • Atoti What-If 4.0.4-AS6.1:
@Bean
public IDatabaseSimulationsSecurityManager securityManager() {
    return new SpringDatabaseSimulationsSecurityManager();
}
  • Atoti What-If 4.1.0-AS6.1:
@Bean
public IDatabaseSimulationsSecurityManager securityManager(ISimulationPersistenceManager persistenceManager, IBranchPermissionsManager branchPermissionsManager) {
    return new SpringDatabaseSimulationsSecurityManager(persistenceManager, branchPermissionsManager);
}

If you have implemented your own security manager, update these methods

Method Previous Parameters New Parameters Details
canUpdate Object databaseSimulationId, IDatabaseSimulation updatedDatabaseSimulation IDatabaseSimulation updatedDatabaseSimulation The database simulation already includes the ID, making the method logic less error-prone.
canUpdate List<Object> databaseSimulationIds, List<IDatabaseSimulation> updatedDatabaseSimulations List<IDatabaseSimulation> updatedDatabaseSimulations The database simulations already include the ID, making the method logic less error-prone.

and implement this new method

Method Parameter Details
canCreateBranch branchName The security manager has to check permissions to create branches as the Atoti Server branch permissions manager also assigns such permissions.

Update your external database schema

If you are using an external database for persisting simulation information, update its schema to include the following changes:

Atoti What-If 4.0.4-AS6.1 Atoti What-If 4.1.0-AS6.1 Modification Field Type Details
DATASTORE_SIMULATIONS DATASTORE_SIMULATIONS Added field executedBy VARCHAR(4000) The executing user will be persisted alongside all other simulation details.

In order to perform these changes, you can run this SQL script:

ALTER TABLE DATASTORE_SIMULATIONS
ADD executedBy VARCHAR(4000);