as per the CustomTaskInstance example, I am subclassing TaskInstance, and adding a couple of simple properties, I have created a new class subclassing TaskInstance, and the hibernate mapping field to go with it...
What I am unsure about, is how the hibernate mapping file relates to my MySQL database, do I need to modify the original TaskInstance table in MySQL to reflect the changes (fields added) in my new extended class, or do I create a new table JBPM_NEWTASKINSTANCE that is a duplicate of JBPM_TASKINSTANCE table but with the new fields added.
My hibernate mapping file is listed below...
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping default-access="field"> <subclass name="com.mycomp.taskinstance.NewTaskInstance" extends="org.jbpm.taskmgmt.exe.TaskInstance" discriminator-value="C"> <property name="someVariable1" column="SOMEVARIABLE1_" /> </subclass> </hibernate-mapping>
INFO Configuration : Reading mappings from resource : com/mycomp/taskinstance/NewTaskInstance.hbm.xml INFO HbmBinder : Mapping subclass: com.mycomp.taskinstance.NewTaskInstance -> JBPM_TASKINSTANCE
WARN JDBCExceptionReporter : SQL Error: 1054, SQLState: 42S22 ERROR JDBCExceptionReporter : Unknown column 'newtaskins0_.SOMEVARIABLE1_' in 'field list'
I think that we are using 'one table per class hierarchy' by default in JBPM, and therefore I should be including the new properties in the JBPM_TASKINSTANCE table... but I just wanted to get an idea of how it works from the experts :-)
Thanks for your help,