martes, 14 de mayo de 2013

How to configure BonitaSoft engine with Tomcat and Mysql database


To do configuration we need to have following software install.
1)Download the Apache tomcat from the bonitasoft site and unzip it.http://www.bonitasoft.com/products/BPM_downloads (In "Bundle" tab you can find "Tomcat" with download link)
2)Download and install the Mysql database. You can download mysql community edition fromhttp://dev.mysql.com/downloads/mysql/
3) you should have JDK ( JDK- 1.6 and JDK -1.7) on your machine. If you don’t have one you can download and install it from - http://www.oracle.com/technetwork/java/javase/downloads/index.html
4)Download the Bonita Soft from the bonitasoft site and unzip it.http://www.bonitasoft.com/products/BPM_downloads (In "Bonita Open Solution" tab you can find "Bonita soft" with download link)
Following are step to install bonita soft
Step 1. Create two databases named bonita_history and bonita_journal.
Commands:
Create database bonita_history;
Create database bonita_journal;
Step 2. Create user “bonita” with password as “bpm” and grant all permissions for above created two databases.
Commands:
CREATE USER 'bonita'@'localhost' IDENTIFIED BY 'bpm';
GRANT ALL ON bonita_history.* TO 'bonita'@'localhost';
GRANT ALL ON bonita_journal.* TO 'bonita'@'localhost';
Step3. Essentially the downloaded Apache tomcat with BOS configuration uses H2 database and it internally uses hibernate framework for database interaction, and these two file store the database properties required by the BOS . So, we need to modify these two files.
Modify BOS configuration files names bonita-journal.properties and bonita-history.properties, as mentioned below:
(Note:Tthese two files are located at –“ BOS-5.9.1-Tomcat-6.0.35\bonita\server\default\conf”)
Comment the “hibernate.dialect” of H2 database. (Note: To comment out in properties file we use “#”)
Comment “bonita.hibernate.interceptor” attribute as well.
Un comment “hibernate.dialect” and “bonita.hibernate.interceptor” from “Examples- MYSQL” , make sure that the values of these 2 attributes are “org.hibernate.dialect.MySQL5InnoDBDialect” and “org.ow2.bonita.env.interceptor.MySQLDescNullFirstInterceptor” respectively for Mysql database.
Also we need to configure the hibernate properties in context.xml file which is located at “BOS-5.9.1-Tomcat-6.0.35\conf”, the properties which needs to be configured is as shown below (This needs to be done twice for both databases under name – “bonita/default/journal” and “bonita/default/history”) :
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="1"
maxPoolSize="15"
minPoolSize="3"
maxConnectionAge="0"
maxIdleTime="1800"
maxIdleTimeExcessConnections="120"
idleConnectionTestPeriod="30"
acquireIncrement="3"
testConnectionOnCheckout="true"
removeAbandoned="true"
logAbandoned="true"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/bonita_journal?dontTrackOpenResources=true"/>
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="1"
maxPoolSize="15"
minPoolSize="3"
maxConnectionAge="0"
maxIdleTime="1800"
maxIdleTimeExcessConnections="120"
idleConnectionTestPeriod="30"
acquireIncrement="3"
testConnectionOnCheckout="true"
removeAbandoned="true"
logAbandoned="true"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/bonita_history?dontTrackOpenResources=true"/>
Step5:Once the above configuration is done, add mysql-jdbc diver (http://dev.mysql.com/downloads/connector/j/ ) into “BOS-5.9.1-Tomcat-6.0.35\lib\bonita” location and remove h2-1.2.139.jar from this location as it is no more required.
step6: Start the tomcat server by navigating to “BOS-5.9.1-Tomcat-6.0.35\bin” location and running command startup.bat from the windows command prompt.
Step7:Once the tomcat server starts hit this url http://localhost:8080/bonita/ , use default credentials user – “admin” and password- “bpm” to login. If you are able to login with no errors then the configuration is fine.(if not login clear browser cache)
Step8:Bonita creates almost 69 tables into the above 2 created database, to verify execute command “select * from bonita_journal;” from the mysql client.
step9:After the first run you need to comment “hibernate.hbm2ddl.auto” property from bonita-journal.properties and bonita-history.properties files as it is needed to create the table only at first run.
Note:If you have created process in bonita soft studio after that export that process from bonita soft studio and
go in http://localhost:8080/bonita/ in that left side "Administration " link where processes link there to install new process in that