The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

JDeveloper (6) [Avatar] Offline
Quick Question -

Your post "Activiti in Action updates (part 1)" acknowledges that the AIA book is now inaccurate regarding install and gives some info. However, it seems really general and vague in that post, very general. Could you take a couple seconds for a couple quick questions -

1. Is there a part 2 to that post that I am not finding ?

2. I need to understand how to change the configuration from the in-mem H2 to persistent H2, and after that, to MSSQL later. I follow the advice in the stack trace "___ set <property name="databaseSchemaUpdate" to value="true" or value="create-drop" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation___" Which I did in both files of that name, the one under srcmain and the one under the target dir. Nothing different happens when I run the unit test, same exception. Should that have already created the Activiti tables ? If not , how do I do it ? >

3. What else do I need to do to make it use the persistent version of H2 ?. I have H2 installed, created a test table and couple records, works great. I need info on how to configure Activiti to use H2, which your post Does Not Address.

4. Could you briefly list a series of steps of what I need to do to change the database from H2 to SQL , which will be next ? I have the Activiti 5.14 User Guide and the Database Configuration section. There are some fragments of a file - What File Even Is That ? The Whole User Guide has the tone of something that was written by and for people that already understand what's being written about. How hard would it be to have a section titled "How to Configure Activiti to use MSSQL ?" rather than a rather airey short section that kind of points things out in a kind of high level way ?

5. I think the User Guide is deficient, I realize you did not write it, and hope you might be able to list a series of steps to take.

Thanks for your help and participation in this forum -
mangelo (25) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL
I have this exact same problem. I downloaded the H2 database and stated it. I tried to run the unit test from chapter 1 and I get the issue that is described here. I tried to add the databaseSchemaUpdate property, but I still get the error.
mangelo (25) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL
I have downloaded the H2 database, have it running, and have run the create scripts from Activiti. When I tried to run the chapter 1 unit test, its said that the library version was 5.9, but the database version is 5.14.

I updated the pom.xml file to switch to Activiti 5.14 and get the following error when I attempt to run the unit test:

Activiti database problem: Tables missing for component(s) history, identity

In addition to this, a lot of the classes now have compile errors.

Message was edited by:
tijs.rademakers (494) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL
@Mangelo did you get the latest source code from the Google code Activiti in Action repository? Or did you download the source code from the book website and use that version?

Best regards,

tijs.rademakers (494) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL

1. No there's no part 2 yet, because I didn't get much feedback on which topics I should touch in a second part. Most of the difficulties with the Activiti in Action book and later Activiti versions has already been touched in part 1.

2. You say "same exception", which exception is that? Did you update the source code to the latest version in the Activiti in Action Google code repository?

3. When you have H2 installed then you only need to change the database URL configuration.

4. I don't agree. How to configure Activiti to use MSSQL would be a post of just 4 lines, showing the MSSQL database URL configuration, that's all.

5. The only thing that needs to be changed to configure Activiti to connect to MSSQL is:

<property name="jdbcUrl" value="jdbc:jtds:sqlserver://"/>
<property name="jdbcDriver" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="jdbcUsername" value="test"/>
<property name="jdbcPassword" value="test"/>

Best regards,

mangelo (25) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL
I downloaded the code from google. I ran the H2 db as a separate process and the unit tests for chapter 1 now pass.

I modified the src/main/resources/activiti.cfg.xml so that it would use an H2 db in my home directory:
<property name="jdbcUrl" value="jdbc:h2:tcp://localhost/~/activiti" />

When I connect to this DB with the web based console, I do not see any new tables.

Other than this, it looks like going with Activiti 5.12 would be the best route.

Thanks for the quick reply!
tijs.rademakers (494) [Avatar] Offline
Re: Changing from in-mem H2 to H2 to MSSQL
Ok. The Activiti tables should be there in the web based console. I'll see if I can update the source code so that in runs with Activiti 5.14 as well.

Best regards,