AnsweredAssumed Answered

Activiti/Spring Boot disable activiti table generation on startup if tables exist

Question asked by shere_khan_ on Dec 22, 2016
Latest reply on Jan 5, 2017 by gdharley

I have a spring boot application with activiti integrated via org.acitviti.spring-boot-starter-basic.

 

I created the activiti tables via sql scripts. When I start spring boot, activiti complains that the tables already exist. So I added the following code to potentially stop jpa from complaining the tables exist:

 

@Bean
StandaloneProcessEngineConfiguration standaloneProcessEngineConfiguration() {
StandaloneProcessEngineConfiguration standaloneProcessEngineConfiguration =
new StandaloneProcessEngineConfiguration();
standaloneProcessEngineConfiguration.setDatabaseSchemaUpdate("true");
return standaloneProcessEngineConfiguration;
}

 

But now I get the below stack trace:

 

Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.activiti.engine.ProcessEngineConfiguration] is defined: expected single matching bean but found 2: standaloneProcessEngineConfiguration,springProcessEngineConfiguration
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1126)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545)
... 25 more

 

Basically, the bean is already defined by default and I need to figure out a clean workaround for this. How can I configure activiti/spring such that the tables aren't created on spring startup?

Outcomes