7 Replies Latest reply on Oct 16, 2013 3:56 PM by coconut788

    Work Item not persisted

    coconut788

      I configured JBPM5.4 persistence based on tutorial. After starting the session, I could see insertion into ProcessInstanceInfo and SessionInfo, but nothing happened for WorkItemInfo table. I do have human task in my flow and I registered HumanTaskHandler correctly, and when the flow hit the human task, the code is running inside excuteWorkItem().

       

      I am so frustrated that workItemInfo is not inserted or update, although I could see the workItem_Id fro the sequence table which is as expected.

       

      Could someone give me any idea of what could be wrong?

       

      Thank you!

        • 1. Re: Work Item not persisted
          mdegan

          Hi,

           

          Please share the persistence.xml as that might help in understanding the components that are persisted. Ideally if you have the following entry in persistence.xml, workitem info should be persisted:

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

           

          Regards,

          Manny

          • 2. Re: Work Item not persisted
            josdel

            After leaving from a workitem the data persisted in the WorkitemInfo table will be deleted

            • 3. Re: Work Item not persisted
              coconut788

              Thank you !

              I understand that after leaving the workitem, that data will be deleted. The thing is in console I never see Insertion into workItemInfo or delete either....

              • 4. Re: Work Item not persisted
                josdel

                You can able to get the data in your Workitemhandler, from there you can log or save the data. If you using the Human Task, you can see the data in WorkitemInfo Table. Because  the workitem is waiting for the human response.

                • 5. Re: Work Item not persisted
                  coconut788

                  yes. I am using a human task but I don't have a task service or server. I just created a HumanTaskHandler implementing WorkItemHandler, and complete that workItem when someone hit the button on UI. It should be very simple. But my problem is I cannot see anything in the WorkItemInfo table so when I try to call completeWorkItem, it just cannot find the right workItem to complete.

                  • 6. Re: Work Item not persisted
                    josdel

                    No need of code for completing Human Task workitem.  In HumanTaskHandler, there is already existing the code for completing workitem. Also whenever the human task completed, then the workitem will be completed. If u want to customize the code for Human task you just use custom Human Task Handler.

                    • 7. Re: Work Item not persisted
                      coconut788

                      My human task handler implements WorkItemHandler. I complete a workitem outside the handler by using kesession.getWorkItemManager().completeworkItem(id,result).

                       

                      Actually, my problem is not in complete the workItem. The problem lies in when start the process and a human task, no entry is inserted into WorkItemInfo. It look s like it is a transaction problem.