0 Replies Latest reply on Oct 10, 2012 5:41 AM by amadets

    jbpm 5.3 and Springframework

    amadets Newbie

      Hello,

      I spent a lot of time to solve the problem but still she can not properly configure the environment.

      I'm using:

      Spring framework ver. 3.1.2

      where my ApplicationContext-db is:

      <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">

        *.hbm.xml etc

      </bean>

      and

       

        <Bean id = "transactionManager"

          class = "org.springframework.orm.hibernate3.HibernateTransactionManager">

          <property name="sessionFactory" ref="sessionFactory" />

        </ Bean>

       

       

      I use the filter OpenSessionInView coming from Spring.

      The whole environment is set on jboss 7 and PostgreSQL 9.1.

       

       

      For this environment wants to connect jbpm5.3.

      In the application I create META-INF/persistence.xml file where I configure:

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

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

      and

      <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>

      <property name="hibernate.connection.url" value="jdbc:postgresql://localhost/mydatabase" />

      <property name="hibernate.connection.username" value="postgres"/>

      <property name="hibernate.connection.password" value="postgres"/>

      <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" />

       

       

      Initializing jbpm code:

      emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

      env = KnowledgeBaseFactory.newEnvironment();

      env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

       

       

      org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService (emf, SystemEventListenerFactory.getSystemEventListener ());

      Map <string, Group> groups = new HashMap <string, Group> ();

      <string, User> Map users = new HashMap <string, User> ();

      taskService.addUsersAndGroups (users, groups);

      localTaskService = new LocalTaskService (taskService);

      ksession = JPAKnowledgeService.newStatefulKnowledgeSession (kbase, null, env);

       

       

      SyncWSHumanTaskHandler humanTaskHandler = new SyncWSHumanTaskHandler (new LocalTaskService (taskService), ksession);

      humanTaskHandler.setLocal (true);

      humanTaskHandler.connect ();

      ksession.getWorkItemManager (). registerWorkItemHandler ("Human Task", humanTaskHandler);

      logger = new JPAWorkingMemoryDbLogger (ksession);

       

       

      When the environment and the process are runing, i complete task's (localTaskService.complete(taskId, "user", null) and is stored in the database and only Task (!).

       

      why not write to database a sessionInfo, processInstanceInfo etc.. What else do I need to set the whole environment to work?

      whether it is possible to set one transaction for the whole environment?

      Additionally, displayed on the console:

      AbstractEntityManagerImpl] Calling joinTransaction () on a non JTA EntityManager.

       

      Additionally, when I set a whole as it is described in:

      http://docs.jboss.org/jbpm/v5.3/userguide/ch.integration.html # d0e7631

      This environment does not start and the message is

      no active Transaction with SingleSessionCommandService (152: persistenceContext.joinTransaction ()

       

      Please any tips

      ts