[jboss-user] [jBPM] - Re: saving state after workitem

Chris Melas do-not-reply at jboss.com
Tue Jan 31 06:42:29 EST 2012


Chris Melas [https://community.jboss.org/people/melc] created the discussion

"Re: saving state after workitem"

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

--------------------------------------------------------------
Hi,
I tried out your code on jboss7, mysql and it worked fine with the following changes applied,

1. Introduce a KnowledgeRuntime field in your handler,
public class SaveStateWorkItemHandler implements WorkItemHandler {
*private KnowledgeRuntime session;*

    public SaveStateWorkItemHandler() {
    }

    public SaveStateWorkItemHandler(*KnowledgeRuntime session*) {
        this();
 *this.session = session;*
    }
......

2. Complete the work item in your SaveStateWorkItemHandler as follows,
....
System.out.println("******** END SAVE-STATE SLEEP *************");
*session.getWorkItemManager().completeWorkItem(myWorkItem.getId(), null);*

3. Register your handler accordingly,
*ksession.getWorkItemManager().registerWorkItemHandler("SaveState", new SaveStateWorkItemHandler(ksession));*
--------------------------------------------------------------

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

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/20120131/1141a379/attachment.html 


More information about the jboss-user mailing list