Hello,
I am new to Flowable and I have a springboot app in which I want to implement multi-tenancy where each tenant has its own db.
I have found some answers at the forum but some are old so I don’t know if they are still valid.
I’ve also checked flowable-engine/modules/flowable-engine/src/test/java/org/flowable/engine/test/cfg/multitenant/MultiTenantProcessEngineTest.java at main · flowable/flowable-engine · GitHub and flowable-engine/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cfg/multitenant/MultiSchemaMultiTenantProcessEngineConfiguration.java at 9af12c0df51ef9cb29e1cd05a1fb015f1a80a021 · flowable/flowable-engine · GitHub
I am using flowable-spring-boot-starter dependency at my pom.xml and I saw here: Multi-Schema Process and Event Registry Engine Advice - #4 by chaserb that it’s not supported but it can be configured.
So, I have to add something like the following at my app?
@Bean
public ProcessEngineConfiguration processEngineConfiguration() {
TenantInfoHolder tenantInfoHolder = new DummyTenantInfoHolder();
MultiSchemaMultiTenantProcessEngineConfiguration config = new MultiSchemaMultiTenantProcessEngineConfiguration(tenantInfoHolder);
config.setDatabaseType(MultiSchemaMultiTenantProcessEngineConfiguration.DATABASE_TYPE_H2);
config.setDatabaseSchemaUpdate(MultiSchemaMultiTenantProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
// Other configurations, e.g async executor, idm, event registry
//todo: get tenants from tenant configuration repository
// Set up the data source for each tenant
config.registerTenant("tenant1",createDataSourceForTenant1());
config.registerTenant("tenant2",createDataSourceForTenant2());
return config;
}
Is that enough? If the whole process engine configuration is overridden should I also configure other things?
Is there somewhere some documentation that I’m missing or some sample project?