in Activiti

How to install activiti with mysql

Introduction

In this tutorial we are going to explain how to

  • install activiti, activiti-explorer and activiti-rest applications to your server
  • connect activiti to your mysql database server
  • skip creation of demo data
Download and install
  1.  Download Activiti here :).
  2. Installing Tomcat
    1. Windows: download tomcat from here
    2. Ubuntu: type this command
      sudo apt-get install tomcat7
  3. In the downloaded zip you can find activiti-rest.war and activiti-explorer.war files, copy them into tomcat/webapps
  4. Start the Tomcat
  5. Find activiti on next addresses:
    http://localhost:8080/activiti-explorer

    Activiti REST can be found here

    http://localhost:8080/activiti-rest/services
    
    
  6. Login using username and password kermit/kermit

 

MySQL Server

Activiti by default uses in memory database H2,that menas that each time you restart your tomcat server you are going to lose all of your tasks,  users and so on.

In case you do not have MySQL server installed you can install it either by downloading it from their download page or in case you are using Ubuntu server by typing :

sudo apt-get install mysql-server mysql-client

Activiti applications need to connect to mysql server using connector that you need to download from here .  After you download it put in inside both war files in lib folder.

Activiti database settings can be found in

activiti-explorer\WEB-INF\classes\db.properties
activiti-rest\WEB-INF\classes\db.properties

We want it to look like this to applications would connect to mysql server that we have previously installed.

db=activitiblog
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/activitiblog?characterEncoding=UTF-8
jdbc.username=activiti
jdbc.password=activitiPass

After modifying db.setting start the tomcat and you are ready to go.

Disabling Activiti Demo Data

Demo data is created after you start the server for the first time, to disable this find the file

activiti-explorer\WEB-INF\activiti-standalone-context.xml

In the beginning of the file you will find bean definition demoDataGenerator :

<bean id="demoDataGenerator" class="org.activiti.explorer.demo.DemoDataGenerator" init-method="init">
 <property name="processEngine" ref="processEngine" />
 
 <!-- Set following properties to false if certain demo data is not wanted -->
 <property name="createDemoUsersAndGroups" value="true" />
 <property name="createDemoProcessDefinitions" value="true" />
 <property name="createDemoModels" value="true" />
 <property name="generateReportData" value="true" />
 </bean>

Set values to false to properties that you do not require demo data to be created.

Summary

In this tutorial we have learned

  • to install Tomcat
  • to install Mysql server
  • to install activiti-explorer and activiti-rest
  • Connect apps to mysql server
  • Disable creation of demo data

We have written nice tutorial on how to extend activiti-rest and we encourage you to read it.

Don't be shellfish...Tweet about this on TwitterShare on LinkedInShare on Google+Share on RedditShare on Facebook

Was this helpful ?

  1. This was helpful except the last part

    Disabling Activiti Demo Data

    Demo data is created after you start the server for the first time, to disable this find the file
    activiti-explorer\WEB-INF\activiti-standalone-context.xml

    The file mentioned doesn’t exist

    • Hello,
      it depends what version you are using. If you have 5.17 you can find file engine.properties with this properties

      # demo data properties
      create.demo.users=true
      create.demo.definitions=true
      create.demo.models=true
      create.demo.reports=true

      Hope this helps!

  2. yes it is very useful but it didnt work ?!! plz can you tell mee what activitiblog in
    db=activitiblog
    jdbc.driver=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/activitiblog?characterEncoding=UTF-8

    and what is username and pass is it the server user or database user
    jdbc.username=activiti
    jdbc.password=activitiPass