I’m trying to integrate Flowable into an existing Spring Boot application and I need to use different db/schema for Flowable tables for several reasons: we use Flyway for migrations and jOOQ with its code generation on top of db schema. So, I want to move Flowable tables to a separate schema in PostgreSQL.
As a result, tables were successfully created in the flowable schema, but then I’m getting “relation “act_ge_property” does not exist” exception, and looks like app repository tries to find tables in a default public schema.
I suppose that there is some conflict between your own ProcessEngineConfiguration and the flowable Spring boot configuration?
Are you using the flowable auto configuration?
I would suggest you to have a look at the ProcessEngineAutoConfiguration. What you need to do is to provide your own bean of SpringProcessEngineConfiguration and when creating that provide your own configuration and pass your own configured DataSource.
Or in order to keep the same defaults you could provide a custom EngineConfigurationConfigurer<SpringProcessEngineConfiguration> and pass your own DataSource to the Flowable engine configuration.
Yes, I’m using auto-configuration which comes with flowable-spring-boot-starter package. Thanks for pointing me to EngineConfigurationConfigurer – now it works with a bean like this: @Bean
EngineConfigurationConfigurer EngineConfigurationConfigurer(@Qualifier(“flowableDataSource”) DataSource dataSource) {
return engineConfiguration → engineConfiguration.setDataSource(dataSource);
}
Hi
Would you mind sharing more details of how your solved this?
I used to have some my application with BPMN processes running in Java SE standalone. But today I’m required to migrate to Spring Boot which I never used. So far I’m able to load a sample process and create tasks by following Spring Boot + Flowable instructions, its going well, but I’m having a harder time moving from h2 DB to postgres. Specifically I don’t see clearly how to set up the processEngineConfiguration bean.
@allanberrocal I think that your use case is different than @dstropalov. He has a more complex requirement (in comparison to you, I suppose).
If you have a normal Spring Boot project (with the Spring Boot starter as a parent) then the only thing that you need to do is to add the postgresql driver
To include the dependency that’s correct. I’m wondering how I should initialise the connection to the DB in the ProcessEngineConfiguration. For instance, the below snippet shows how I was doing it before.
@filiphr is right, there is no need in setting ProcessEngine bean configuration in your case. All you need (in a case of a regular Spring Boot application) is to configure a data source (look at this tutorial http://zetcode.com/springboot/postgresql/), and once you’ll have it configured, Flowable will use PostgreSQL, no other configuration is needed.
Be sure that you’re using org.flowable:flowable-spring-boot-starter dependency in your project, because it provides auto configuration for Flowable in a Spring Boot environment.
One other thing to note which I am not 100% sure how the entire starter will behave. As there the SpringAppEngineConfiguration is in the lead. Which means that you might need to configure the EngageEngineConfigurationConfigurer<SpringAppEngineConfiguration> and set the DataSource there.
Hi
I’m searching also how to separate flowable tables from my business database. I tried this bean @Bean
EngineConfigurationConfigurer EngineConfigurationConfigurer(@Qualifier(“flowableDataSource”) DataSource dataSource) {
return engineConfiguration -> engineConfiguration.setDataSource(dataSource);
}
but what i noticed that even it created the flowable tables in the dedicated database, some of my business tables were created in flowable database, so would you mind sharing more details of how your solved this?