1. Install the jdbc driver for ms sql server - create a folder lib/jtds and put jtds-1.1.jar into it(get jtds from http://jtds.sourceforge.net/)
2. in core/schema.generation.properties add
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
and comment out
hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
at the top of the file
3. in core run
ant generate.ddl
This should create a file core/target/sql/create-jbpm-database.sql. If the ant task fails
remove the ../ in in the file core/build.xml in the generate.ddl target.
4. manually create a database "jbpm"
5. manually create a user jbpmuser and add the users to the jbpm database as dbo.
6. comment out all the drop statements at the top of the create_jbpm_database.sql file
7. change the script for the JBPM_FILE.bytes field to IMAGE type
create table JBPM_FILE (
id NUMERIC(19,0) not null,
name VARCHAR(255) null,
definitionId NUMERIC(19,0) null,
bytes IMAGE null,
primary key (id)
);
8. run the file in the jbpm database - since we removed the drop statements you should get a feedback with no errors at all. In Query Analyser this would be:
The command(s) completed successfully.
9. Uncomment the drop statements for future clean outs and keep the file somewhere handy (ant clean would remove it). You could script the db and user creation and keep them all together somewhere...
10. in core/src/test/resources/jbpm.properties add
hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
hibernate.connection.url=jdbc:jtds:sqlserver://localhost:1433/jbpm
hibernate.connection.username=jbpmuser
hibernate.connection.password=jbpmuser
hibernate.query.substitutions=true 1, false 0
hibernate.show_sql=true
with the correct password for the jbpmuser.
11. Change the testDatabaseFileMgr in FileMgrTest to
public void testDatabaseFileMgr() throws Exception { long id = new Date().getTime(); PersistenceSession persistenceSession = JbpmConfiguration.getInstance().getPersistenceSessionFactory().openPersistenceSession(); persistenceSession.beginTransaction(); persistenceSession.storeBytes( new Long(id), "org/jbpm/test/DatabaseFileMgrTest.bin", create5KbBinaryData() ); byte[] retrievedBytes = persistenceSession.retrieveBytes( new Long(id), "org/jbpm/test/DatabaseFileMgrTest.bin" ); assertEquals( new String(create5KbBinaryData()), new String( retrievedBytes ) ); persistenceSession.commitTransaction(); persistenceSession.close(); }
This fixes the problem that multiple runs of ant test fail since the id used is hardcoded to 1 in the original code.
12. in core run
ant test
This should run without any failures.
Up to here you have a fully working jbpm installation. I will get going and get the web and ejb app to work as well and document more here when I got it.
Manfred
-
Example
To get the example to work add the hibernate properties from 10 in example/src/config/jpbm.properties
You should be able to run "ant test" as well as "ant deploy.process.archives" in the example folder.
-
Web
To get the web part to work add the hibernate properties from 10 in web/src/test/resources/jbpm.properties and web/src/jbpm.war/WEBINF/classes/jbpm.properties. You should then be able to run
ant test
ant deploy
ant deploy.process.archives
and actually use the application on http://localhost:8080/jbpm
(assuming you set up your jboss server and jbpm configuration already..)
Comments