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&...]