Information Technology Reference
In-Depth Information
<version>6.1.0.Beta3</version>
</dependency>
Once we have these dependencies in our project, we can configure the persistence unit
that will be used by our Human task component's implementation.
As previously mentioned, the Human task component is basically a JPA-backed applica-
tion that will handle the stateful nature of Human tasks with a database. For it to work, it
needs a persistence unit configured in the
META-INF/persistence.xml
file in our
classpath, pointing to all the database entity class mappings and data source configura-
tions. In the
human-task-components-api
project inside this chapter's code, you
will find the
persistence.xml
file in the
src/main/resources
folder. The con-
tent of this file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/
orm"
xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance"
...>
<persistence-unit name="org.jbpm.services.task"
transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testDS</jta-data-source>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
<class>org.jbpm.services.task.impl.model.AttachmentImpl</class>
<class>org.jbpm.services.task.impl.model.ContentImpl</class>
<class>org.jbpm.services.task.impl.model.BooleanExpressionImpl
</class>
<class>org.jbpm.services.task.impl.model.CommentImpl</class>
<class>org.jbpm.services.task.impl.model.DeadlineImpl</class>