使用jBpm支持高级用户交互模式
2010-01-21 00:00:00 来源:WEB开发网清单7 Assignee类
自定义的TaskInstance类和Assignee类都必须保存到数据库中。这意味着需要给这两个类实现Hibernate映射 (清单8,9):
<?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 auto-import="false" default-access="field">
<subclass namename="com.navteq.jbpm.extensions.AssignableTaskInstance"
extends="org.jbpm.taskmgmt.exe.TaskInstance"
discriminator-value="A">
<list name="assignees" cascade="all" >
<key column="TASKINSTANCE_" />
<index column="TASKINSTANCEINDEX_"/>
<one-to-many class="com.navteq.jbpm.extensions.Assignee" />
</list>
</subclass>
</hibernate-mapping>
清单8 自定义任务实例的Hibernate映射文件
<?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 auto-import="false" default-access="field">
<class name="com.navteq.jbpm.extensions.Assignee"
table="JBPM_ASSIGNEE">
<cache usage="nonstrict-read-write"/>
<id name="id" column="ID_"><generator class="native" /></id>
<!-- Content -->
<property name="startDate" column="STARTDATE_" />
<property name="userID" column="USERID_" />
<property name="endDate" column="ENDDATE_" />
</class>
</hibernate-mapping>
更多精彩
赞助商链接