cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid generating demodata in rest-webapp

b_schnarr
Champ in-the-making
Champ in-the-making
Hello at all,

I have the following deployment:

One MySQL-Database for both instances (activiti-rest.war and activiti-explorer.war). Database name is activiti.
First, I deployed the activiti-rest.war. After that, I configured the database like this in db.properties:


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


After that, I copied the mysql-connector-java-5.1.27-bin.jar in the corresponding lib-Folder. In addition, I disabled the generation of demodata for the rest webapp in the activiti-context:


   <bean id="demoDataGenerator" class="org.activiti.rest.service.demo.DemoDataGenerator"
      init-method="init">
      <property name="processEngine" ref="processEngine" />
      <property name="createDemoUsersAndGroups" value="false" />
        <property name="createDemoProcessDefinitions" value="false" />
        <property name="createDemoModels" value="false" />
   </bean>


After that, I deployed the activiti-explorer.war, pointing to the same db. I changed db.properties to the same code as above. After that, I copied the MySQl-Connector in the lib-Folder. I did NOT change the generation of demodata. Therefore, the explorer will generate demodata.

After the deployment, everything works fine, I have no tasks. The explorer is empty except of the demodata.
After I did one REST-Call for testing, e.g.  get-Request to : http://ip-address:8080/activiti-rest/service/identity/users, the activiti explorer is full of tasks in inbox, Queue, Involved etc (see picture: https://www.dropbox.com/s/r7e4mfd4oqakfn1/explorer.png). In the middle of explorer, there is the message: Warning: userid is null. All tasks are discribed with lorem ipsun text.

Why does this happen? I explicitely disabled the generation of demodata in the rest webapp. But after the first rest-call, the explorer looks like the picture. Any ideas?

Thank you very much for your help
4 REPLIES 4

b_schnarr
Champ in-the-making
Champ in-the-making
One step further: When I just deploy the activiti-rest.war (without the activiti explorer), the webapp generates after each restart an entry in the two tables act_hi_taskinst and act_ru_task even though I disabled the generation of demodata. The table act_ru_task looks like this after some restarts: https://www.dropbox.com/s/3a4u16nzlupus3a/activiti-database.png

Does anyone has a solution?
Thank you very much

trademak
Star Contributor
Star Contributor
The issue with the REST web application generating demo tasks is fixed in Github master. So it will be fixed in release 5.15.

Best regards,

b_schnarr
Champ in-the-making
Champ in-the-making
Found a workaround: When you set the properties in the activiti-context.xml to false like this:

<code>
<bean id="demoDataGenerator" class="org.activiti.rest.service.demo.DemoDataGenerator"
  init-method="init">
  <property name="processEngine" ref="processEngine" />
  <property name="createDemoUsersAndGroups" value="false" />
        <property name="createDemoProcessDefinitions" value="false" />
        <property name="createDemoModels" value="false" />
</code>
the rest app still produces demo data. If you comment out the whole code-block like this:

<code>
<!– Comment this if you don't need demo data
<bean id="demoDataGenerator" class="org.activiti.rest.service.demo.DemoDataGenerator"
  init-method="init">
  <property name="processEngine" ref="processEngine" />
  <property name="createDemoUsersAndGroups" value="true" />
        <property name="createDemoProcessDefinitions" value="true" />
        <property name="createDemoModels" value="true" />
</bean>
  –>
</code>
no demo data will be generated.

m_koohi_m
Champ in-the-making
Champ in-the-making
I've found a solution for this problem but I don't know, how much is this stable!!

After configuration Activiti-Rest and Activiti-Explorer to use the same PostgreSql database, I ran into this problem!

I've tried to modify the Postgres tables and clean the demo data to solve the problem. I use ECM postgreSQL manager to remove demo data from tables. But the DELETE status of act_ru_identifylink (and also other tables that have the demo data and you should clean them) should be changed to CASCADE.

After cleaning database, I can run my REST properly. Also I don't have any strange Latin task in Kermit task list. For the second time that I wanted to run my Tomcat, I've commented out the whole code-block in activiti-context.xml.

It works now properly! I don't know, how much is this solution reliable!