3 Replies Latest reply on Jan 19, 2011 5:49 PM by khalipili

    jBPM5 Persistance issue creating multiple human task

    khalipili

      I have created a simple workflow, it contains first 2 action event, 1 rule task then a human task and again an action task. I have configure JBPM to persist the session/process in mysql. now when i start the process everything works file till human task. jbpm persist the process, signal to task service and wait for response from task service. i am able to view the human task in jbpm console too.

       

      now i closed my current running program/process; as this process has already initiated human task, transaction manager has persisted the state in DB. if i view in the mysql db, i am getting only one task and one entry in "eventtypes" table (Entry for ruleflow - this event has already completed before human task - not quite sure why its still there).

       

      Later I restarted the process; process started successfully and processed till human task. Now if we look into jbpm console for human task,it shows 3 (three) human task 1) 1 from current process and 2) 2 from prior process which i closed abruptly.

       

      As my first process runtime was already persisted and human task was created for same, why jbpm is creating human task again. 

       

      i think due to eventytype entry of ruleflow task, which was already completed and not removed by jbpm session. jbpm session is putting duplicate entry in workitems table. this seems to be an issue in jbpm process persistence.

       

       

      Source Code added..

        • 1. jBPM5 Persistance issue creating multiple human task
          krisverlaenen

          Not sure I understand your question, but are you saying that your database contains more tasks then you would be expecting?  In this case, it contains tasks that we're created in a previous session but which are still there, even though you terminated the session (which seems to make sense to me, as terminating a session / process does not remove the tasks)?

           

          Could you maybe share your process and a simple test case that shows this behavior so I can reproduce?

           

          Kris

          • 2. jBPM5 Persistance issue creating multiple human task
            khalipili

            Thanks Kris for looking into this. Please find attached project source code. I am running the "JPAPersistProcessTest.java" program. once the process is completed successfully, i am terminating the program and relaunching it. once we relaunch the program, it is creating task for a prior session.

            • 3. jBPM5 Persistance issue creating multiple human task
              khalipili

              I found issue in my code. I was closing the session before CommandBasedHumanTaskHandler was updating the process instance details in database. Its working fine now. but I found another issue in process execution itself (how Gateway diverge and Gateway converge works in jBPM). I will create a separate discussion thread for that.