How to configure Activiti Explorer and REST to use the same database

If someone wants to merge the activiti-explorer and activiti-rest web application of Activiti 5.22, than this blog would be very useful for them.

There are few steps to deploy both web application together on a single process engine so that they can share database on single engine. 

I have found other approach on web to merge both the webs manually. As per my understanding it's a little bit challenging and not recommended for production environment. 

I have used below setups.

  • Apache tomcat 8.0.27
  • MySql 
  • Activiti 5.22.0

Steps are:
  1. Create Database in MySql (e.g activiti_exp_rest)
  2. In new instance of tomcat, put a Activti-explorer war in webapps folder of Tomcat 
  3. Start the tomcat and monitor the logs.
  4. Shutdown the Server
  5. Now go to [Tomcat]/webapps/activiti-rest/WEB-INF/classes and open files db.properties and activiti-custom-context.xml
  6. In file db.properties, add the entry related to created db.
  7. In file activiti-custom-context.xml, un-comment the beans to register dbProperties, datasource, transcationManager, processEngineConfiguration, processEngine and other services too.
  8. Add the DB dialect in Tomcat]/lib
  9. Start the tomcat and monitor the logs. Server should start without any problem.
  10. Now to Deploy Activit-Rest on same server, Shutdown server again.
  11. Put a Activti-restwar in webapps folder of Tomcat 
  12. Repeat steps 3,4 and 5
  13. Now open file engine.properties from [Tomcat]/webapps/webapps/activiti-rest/WEB-INF folder
  14. We don't need to create again demo properties, make those false.
  15. Start the tomcat and monitor the logs. 

Testing Steps:

  1. Deployed a process using REST API
  2. Verified in Activiti-Explorer UI
  3. Verified in databases tables. 
Happy Learning.............

Thanks
Ratik Singhal




Comments

  1. this is perfect just for test, but what about with a expressions on BPM like custom Java service invoked directly in task from BPM?

    This case just share database but not context to both application

    ReplyDelete

Post a Comment