[jboss-user] [jBPM] - Re: Process persistense - change WHEN it should happen!

nt2005 do-not-reply at jboss.com
Tue Jun 26 11:15:51 EDT 2012


nt2005 [https://community.jboss.org/people/nt2005] created the discussion

"Re: Process persistense - change WHEN it should happen!"

To view the discussion, visit: https://community.jboss.org/message/744305#744305

--------------------------------------------------------------
Hey guys,

There is a simple question, if I do something wrong.

I have many own workitems they look like this:

public class SimpleWorkItem implements WorkItemHandler {

    public static final String NAME = "simple";

    public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        
        System.out.println("WorkItemHandler ->" + workItem.getId() + " - " + workItem.getName());

        // do anything else

        manager.completeWorkItem(workItem.getId(), results);
    }

    public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
    }
}


After start a process and look in the sql command I noticed, that each workitems get a sql-query like:
 Hibernate: 
     insert 
     into
         WorkItemInfo
         (creationDate, name, processInstanceId, state, OPTLOCK, workItemByteArray, workItemId) 
     values
         (?, ?, ?, ?, ?, ?, ?)

 Hibernate: 
     update
         WorkItemInfo 
     set
         creationDate=?,
         name=?,
        processInstanceId=?,
         state=?,
         OPTLOCK=?,
         workItemByteArray=? 
     where
         workItemId=? 
         and OPTLOCK=?

 Hibernate: 
    delete 
    from
        WorkItemInfo 
     where
         workItemId=? 
         and OPTLOCK=?


Is this really necessary - or do I use WorkItems wrong? There was no break between execution, just ksession.startProcess(....)
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/744305#744305]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120626/4285bece/attachment.html 


More information about the jboss-user mailing list