Skip navigation
2013

In this blog, I am going to post the code and files for using the available Human Task War for running the task service.

 

We need to modify the human task war a little to get it running without any other jbpm web archive.

 

1) Change the persistence.xml file

 

 

  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.task" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>jndi/testDS1</non-jta-data-source>
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.BooleanExpression</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Delegation</class>
<class>org.jbpm.task.EmailNotification</class>
<class>org.jbpm.task.EmailNotificationHeader</class>
<class>org.jbpm.task.Escalation</class>
<class>org.jbpm.task.Group</class>
<class>org.jbpm.task.I18NText</class>
<class>org.jbpm.task.Notification</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.PeopleAssignments</class>
<class>org.jbpm.task.Reassignment</class>
<class>org.jbpm.task.Status</class>
<class>org.jbpm.task.SubTasksStrategy</class>
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.User</class>

<class>org.drools.persistence.info.SessionInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
<property name="hibernate.connection.autocommit" value="true" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
<property name="hibernate.id.new_generator_mappings" value="false" />
</properties>
</persistence-unit>
</persistence>

 

I have added the datasource details and changed the transaction manager lookup class and added the process persistence classes too.

 

2) Accordingly I changed the name of the file Taskorm to orm.xml.

3) Also I copied the files ProcessInstanceInfo.hbm.xml and ProcessInstanceInfoMapping.xml to the human task war/ WEB-INF/classes/META-INF

4) Either you can use your custom UserGroupCallBack class or you can keep the default one as it is. But since the human task war is no longer in jboss server, the reference of the file roles.properties need to change in the class DefaultUserGroupCallbackImpl which is available in the core jar of jbpm.

5) I had to add a few jars to the archive to make it work.

 

libs.png

The attached war is modified with all the above changes. But it is modified to run with WebSphere server.

A couple of more things about the attached archive, I use these jars in a shared library. And the archive is by default set to run the HornetQ task server. It can be changed to Mina or JMS by changing the parameters in web.xml.

 

Once this is deployed, it will start up the hornetQ server by itself on 127.0.0.1:5153. The same can be verified from the console logs.

Run the evaluation example after starting up the server, to verify its working.

Any doubts are welcome.

 

Regards,

 

Shobhit Tyagi