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. Linux: type this command or download apache-tomcat package:
      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://yanado.com:8080/activiti-explorer
    Activiti REST can be found here
    http://yanado.com: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.

Depend on the version. We can edit this file to disable demo data (set the value to false):
activiti-explorer/WEB-INF/classes/engine.properties

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

Nhận xét

Bài đăng phổ biến