Hi,
I'm using Activiti community version. I've two databases with Activiti Data. One is the old database and another one is the new and primary database to which the ProcessEngine connects (The reason why we are not using ONE single database is we do not want to migrate the HISTORIC data from OLD database to new database). I'm looking to create a wrapper API service to pull the historic process and task instances from both the primary and old database.
This leads to the need of building a new process engine that connects the old database. I'm able to achieve this by building the process engine on runtime using ProcessEngineConfiguration by setting the old data source.
ProcessEngine processEngine = ProcessEngineConfiguration.
createStandaloneProcessEngineConfiguration().
setDataSource(oldDataSource).
buildProcessEngine();
Doing this way affects the performance as the wrapper service builds the engine on runtime. However, I'm not able to create a new bean to initialize the ProcessEngine with the old datasource
@Bean
public ProcessEngine processEngine1x() {
return ProcessEngineConfiguration.
createStandaloneProcessEngineConfiguration().
setDataSource(oldDataSource()).
buildProcessEngine();
}
Defining the process engine bean as above throws the below error.
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method processEngineEndpoint in org.activiti.spring.boot.EndpointAutoConfiguration required a single bean, but 2 were found:
- processEngine: defined by method 'processEngine' in class path resource [org/activiti/spring/boot/DataSourceProcessEngineAutoConfiguration$DataSourceProcessEngineConfiguration.class]
- processEngine1x: defined by method 'processEngine1x' in class path resource [com/bnym/nwf/config/NWFConfig.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
Is there any other feasible and optimized way of building a separate Process Engine to handle this scenario?
Thanks for the help.
From the error it is quite clear that is confused with the two process engine beans! A couple of options I can think of:
If you are interested in joining this work/contribution you can get in touch with the Activiti team on Gitter. You can find more details about the roadmap and milestones at - https://github.com/Activiti/Activiti/wiki/Activiti-7-Roadmap & https://activiti.gitbooks.io/activiti-7-developers-guide/
Ciju
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.