cancel
Showing results for 
Search instead for 
Did you mean: 

Spring Boot, Activiti 5.18.0 and Drools Integration Issue

jakez15
Champ in-the-making
Champ in-the-making
I am having trouble figuring out to set the customPostDeployers for the Drools RulesDeployer utilizing Java Config and the Spring Boot Auto Configuration. 

Does the Activiti Spring Boot configuration only allow for the BPM Deployer or can I add Drools Rules Deployer also?

5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
I don't think it's possible out of the box. However, you can inject the deployer into to the ProcessEngineConfiguration after the bean has been created.

jakez15
Champ in-the-making
Champ in-the-making
Hmm, I did not find a straight forward way to do that based on the sequencing of events that take place for the auto configuration with spring boot.

I ended up having to create a custom bean that got added to the spring container before the JpaProcessEngineAutoConfiguration and JpaProcessEngineAutoConfiguration classes through the use of the @AutoConfigureBefore annotation.  This is a bit of a hack.

@Configuration
@AutoConfigureBefore({ JpaProcessEngineAutoConfiguration.class,
  JpaProcessEngineAutoConfiguration.JpaConfiguration.class, DataSourceProcessEngineAutoConfiguration.class })
@AutoConfigureAfter(DataSourceAutoConfiguration.class)
public class CustomProcessEngineAutoConfiguration {

It would be nice to see a default strategy approach similar to a lot of the underlying Spring apis that would easily allow devs to hook in a custom strategy.

I might be missing something though.  If so, can you point me in the right direction?




lakerta06
Champ in-the-making
Champ in-the-making

I know it has been 2 years but, any chance you have the full code of CustomProcessEngineAutoConfiguration?

jbarrez
Star Contributor
Star Contributor
What I meant with my comment is that you can @Autowire the ProcessEngine, get the process engine configuration and then add the deployer.

jakez15
Champ in-the-making
Champ in-the-making
Thanks for your response.  This is one of the first approaches I tried but it did not work with Spring Boot which is why I had to implement the hack mentioned above.