cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep the process instances alive

alvin_tw
Champ in-the-making
Champ in-the-making
Hi, I'm new to Activiti. Now i deploy activiti-explorer.war on tomcat 7.
But when i restart the server, the process instances that i started it before will all disappear.
How do i change the configuration to keep the process instances alive. Thanks.
3 REPLIES 3

mmaker1234
Champ in-the-making
Champ in-the-making
Hello Alvin,

As far as I remember, the demo files (including activiti-explorer.war) are using an in-memory (H2) database. This means that any changes to the DB are lost with the shut-down of the application:
db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
in activiti-explorer.war/WEB-INF/classes/db.properties

To persist your changes between the applications restart you need to change the DB persistence mechanism - either to configure the H2 DB to not run in in-memory mode, or to use another DBMS - MySql, Postgre, Oracle, …

By the way, there is a good enough description in the Activiti User Guide: http://activiti.org/userguide/index.html#activiti.setup.database

alvin_tw
Champ in-the-making
Champ in-the-making
Hi,
    Thanks for your reply first. I already changed the database configuration to mysql, my setting is as below.
    But when i start a process instance, i can see a record to be inserted into ACT_RU_TASK.
    And i also can see that in Activiti Explorer Console. But when i restart the jboss, anything includes data in ACT_RU_TASK and instance in console are all disappeared. Is there anything i misunderstand or lose? Thanks.

    db.properties
    ===========================================
    db=mysql
    jdbc.driver=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/activiti
    jdbc.username=activiti
    jdbc.password=activiti
    ===========================================

alvin_tw
Champ in-the-making
Champ in-the-making
Hi,
    I found the problem. I don't turn the demo data generator off. The setting i change as below.
    <code>
   <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="false" /> <!– From true to false –>
    <property name="createDemoProcessDefinitions" value="false" /> <!– From true to false –>
    <property name="createDemoModels" value="false" /> <!– From true to false –>
    <property name="generateReportData" value="false" /> <!– From true to false –>
   </bean>
   </code>
Thanks.