Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save doug4j/6c0676995fbc5b2d1d9c7b9ee87473f2 to your computer and use it in GitHub Desktop.
Save doug4j/6c0676995fbc5b2d1d9c7b9ee87473f2 to your computer and use it in GitHub Desktop.

#Running activiti-explorer and activiti-rest with shared database using h2 (for development)

Sources:

STEPS

  1. Shutdown all Activiti processes
  2. Edit activiti-explorer and activiti-rest files to use a shared database
  3. Start a new terminal/command window (called 'h2-terminal' from herein)
  4. In the h2-terminal, locate the h2s database and start it in server mode using a fixed port
  5. Restart Activiti processes

##Editing db.properties for a shared database

back to tip

a. open up activiti-explorer

vi /Applications/tomcat/apache-tomcat-8.5.8/webapps/activiti-explorer/WEB-INF/classes/db.properties

b. edit db.properties

db.properties BEFORE (out of the box Activiti)

db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
jdbc.username=sa
jdbc.password=

db.properties AFTER

db=h2
jdbc.driver=org.h2.Driver
#jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
jdbc.url=jdbc:h2:tcp://localhost:2962/~/activiti
jdbc.username=sa
jdbc.password=

c. perform the same changes to activiti-rest db.properties

##Run H2 Server

back to tip

# Example where tomcat is installed with activiti-explorer
cd /Applications/tomcat/apache-tomcat-8.5.8/webapps/activiti-explorer/WEB-INF/lib
java -cp h2-1.3.176.jar org.h2.tools.Server -tcpPort 2962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment