Howto integrate jbpm into [fleXive]
Getting jbpm
Download the latest jbpm software bundle [not the installer!] (e.g. from here
).
Extract the downloaded zip file. The resulting directory will be addressed as JBPM_DIR.
Integrating jbpm
Under JBPM_DIR navigate to directory JBPM_DIR/install/src/db/create. Here you can find the sql-scripts for creating the jbpm tables inside your [fleXive] database. Choose the script corresponding to your database vendor and execute it inside your [fleXive] database (see here
on how to do this).
In your [fleXive] source create the jbpm directory inside the [fleXive] lib folder, i.e. create FLEXIVE_HOME/lib/jbpm/.
Copy the jbpm lib-file jbpm.jar from JBPM_DIR to FLEXIVE_HOME/lib/jbpm/.
Create a file named jbpm.cfg.xml containing the jbpm-configuration and store in FLEXIVE_HOME/lib/jbpm/.
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml"/>
<import resource="jbpm.tx.hibernate.cfg.xml"/>
<import resource="jbpm.jpdl.cfg.xml"/>
<import resource="jbpm.bpmn.cfg.xml"/>
<import resource="jbpm.identity.cfg.xml"/>
<import resource="jbpm.businesscalendar.cfg.xml"/>
</jbpm-configuration>
Create a file named jbpm.hibernate.cfg.xml containing the hibernate configuration corresponding to your database vendor and store it in FLEXIVE_HOME/lib/jbpm/.
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:<property name="hibernate.connection.username">YourFlexiveDBUsername</property>
<property name="hibernate.connection.password">YourFlexiveDBPassword</property>
<property name="hibernate.format_sql">true</property>
<mapping resource="jbpm.repository.hbm.xml"/>
<mapping resource="jbpm.execution.hbm.xml"/>
<mapping resource="jbpm.history.hbm.xml"/>
<mapping resource="jbpm.task.hbm.xml"/>
<mapping resource="jbpm.identity.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Make sure that the jbpm lib files are added to the flexive.ear upon build time by adding the following two statements inside your [fleXive] build file (build.xml):
In the classpath section:
<path id="classpath.build.framework">
...
</path>
add
<fileset dir="${flexive.lib.dir}/jbpm" includes="*.jar,*.xml"/>
as another fileset inside the path-tag.
In section:
<target name="jar.ear" depends="prepare" description="Assemble flexive.ear">
...
<copy todir="${build.ear.libs.dir}">
...
</copy>
</target>
add
<fileset dir="${flexive.lib.dir}/jbpm" includes="*.jar,*.xml"/>
as another fileset inside the copy-tag.
Build [fleXive] - jbpm should now be included inside your flexive.ear.