1 Reply Latest reply on Dec 27, 2012 5:25 AM by Laura delli Paoli

    How to make jBPM process data persistent

    Laura delli Paoli Master

      Hello everybody,

      I need to store jBPM process data into my MySql database.

      I was able to have Human Task data stored in Task table, but no information about processes is written on the database.

       

      How can I solve this problem?

       

      Here's my persistence.xml:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <persistence version="2.0"

         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="

              http://java.sun.com/xml/ns/persistence

              http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

       

       

        <persistence-unit name="org.jbpm.task">

          <provider>org.hibernate.ejb.HibernatePersistence</provider>

       

       

          <jta-data-source>java:/jdbc/jbpm-ds</jta-data-source>

         

          <mapping-file>META-INF/JBPMorm.xml</mapping-file>

          <mapping-file>META-INF/Taskorm.xml</mapping-file>

          <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>

         

          <class>org.drools.persistence.info.SessionInfo</class>

          <class>org.drools.persistence.info.WorkItemInfo</class>

          <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

          <class>org.jbpm.process.audit.ProcessInstanceLog</class>

          <class>org.jbpm.process.audit.NodeInstanceLog</class>

          <class>org.jbpm.process.audit.VariableInstanceLog</class>

          <class>org.jbpm.task.Attachment</class>

          <class>org.jbpm.task.Content</class>

          <class>org.jbpm.task.BooleanExpression</class>

          <class>org.jbpm.task.Comment</class>

          <class>org.jbpm.task.Deadline</class>

          <class>org.jbpm.task.Comment</class>

          <class>org.jbpm.task.Deadline</class>

          <class>org.jbpm.task.Delegation</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.EmailNotification</class>

          <class>org.jbpm.task.EmailNotificationHeader</class>

          <class>org.jbpm.task.PeopleAssignments</class>

          <class>org.jbpm.task.Reassignment</class>

          <class>org.jbpm.task.Status</class>

          <class>org.jbpm.task.Task</class>

          <class>org.jbpm.task.TaskData</class>

          <class>org.jbpm.task.SubTasksStrategy</class>

          <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

          <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

          <class>org.jbpm.task.User</class>

       

       

          <properties>

            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>         

            <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.JBossTransactionManagerLookup" />

            <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->     

            <property name="hibernate.id.new_generator_mappings" value="false" />

          </properties>

        </persistence-unit>

       

       

      </persistence>

        • 1. Re: How to make jBPM process data persistent
          Laura delli Paoli Master

          UPDATE:

          If I create an entityManager like this:

          EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task", properties);

          I get an error

          Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named org.jbpm.task

                    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]

                    at eu.discoveryreply.serviceLayer.jbpm.JBpmHelper.loadStatefulKnowledgeSession(JBpmHelper.java:62) [classes:]

                    at eu.discoveryreply.serviceLayer.jbpm.JBpmHelper.newStatefulKnowledgeSession(JBpmHelper.java:47) [classes:]

                    at eu.discoveryreply.serviceLayer.jbpm.JBpmPrimaryWkfLauncher.startWorkflow(JBpmPrimaryWkfLauncher.java:86) [classes:]

                    at eu.discoveryreply.serviceLayer.webServer.StartWkfWS.startWorkflow(StartWkfWS.java:51) [classes:]

                    ... 41 more