3 Replies Latest reply on Apr 1, 2011 6:14 AM by salaboy21

    How to use JPAKnowledgeService ?

    christopherz

      When I use JPAKnowledgeService.newStatefulKnowledgeSession following statements are not executed resulting loss of task information.

       

      Hibernate: insert into PeopleAssignments_BAs (task_id, entity_id) values (?, ?)

      Hibernate: insert into PeopleAssignments_PotOwners (task_id, entity_id) values (?, ?)

       

      It does not happened with

       

      StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        • 1. How to use JPAKnowledgeService ?
          salaboy21

          Can you explain a little bit more about what are you trying to achieve and how is not working?

          Greetings.

          • 2. How to use JPAKnowledgeService ?
            christopherz

            Hi Mauricio,

             

            I'm developing a POC(web application).

            (Human Task 1)  The accountant submits the request form.

            (Human Task 2)  HOD adds in extra remark and approve the forms.

            (Human Task 3) The accountant views the form.

             

            I have mina server running with database for tasks. And pooling datasource for process database. Both in mysql with BTM.

             

            I start the process with the session I got from JPAKnowledgeService.newStatefulKnowledgeSession. I used Human Task View (Eclipse plugin) to query the tasks pending for accountant, I got a task(s). But when I complete the task, the task is not routed to HOD (When I query task list for HOD using the previous method, no tasks return). HOD is an actor in another Human Task node.

             

            I also tried with ManagementFactory.createTaskManagement().getAssignedTasks("hod") , the result is the same, no tasks return for actor(HOD in my case).

             

            If I can get the task assign to HOD, I want to retrieve the varibles associated with the process, show it on the form and add in one more varible called remark when the HOD approved the form with remark. Then the task will route to another human task whose actor is Accountant. That is what I'm trying to achieve.

            • 3. How to use JPAKnowledgeService ?
              salaboy21

              Can you please check the Simple-Human-Task example provided here in this repository:

               

              https://github.com/esteban-aliverti/JBPM-Samples/

               

              That example is using persistence and human tasks together. Can you please check that you are following similar steps that the ones described in the example?