activiti icon indicating copy to clipboard operation
activiti copied to clipboard

Add support for configuring data source

Open dmurat opened this issue 13 years ago • 2 comments

Since grails 2.0.0 now support multiple data sources, it would be nice to add support for configuring data source name in activiti plugin.

If this doesn't brake something else in the plugin (i.e. in scripts), I believe this can be implemented by modifying a single line in ActivitiGrailsPlugin:

processEngineConfiguration(org.activiti.spring.SpringProcessEngineConfiguration) {
  //...
  dataSource = ref("dataSource")
  //..
}

should be replaced with

processEngineConfiguration(org.activiti.spring.SpringProcessEngineConfiguration) {
  //...
  dataSource = ref(CH.config.activiti.dataSourceName ?: "dataSource")
  //..
}

dmurat avatar Feb 11 '12 09:02 dmurat

I've just done some preliminary testing, and it works ok after few known bumps :-) I'm also using activiti-spring-security plugin, and I was able to login with user/role stored in default data source, while activiti executed a process (with full history) against another data source. All activiti data was stored correctly, and querying is working too.

Since I'm using activiti-spring-security plugin, I had this issue: http://jira.grails.org/browse/GPSPRINGSECURITYCORE-114 When I changed spring-security-core's User implementation as suggested there (http://jira.grails.org/browse/GPSPRINGSECURITYCORE-114?focusedCommentId=67373&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-67373), all pieces start working.

dmurat avatar Feb 11 '12 09:02 dmurat

Thanks for further writing and provide solutions for the bumps you hit. I will add multiple data source support in next release of the plugin.

limcheekin avatar Feb 11 '12 14:02 limcheekin