Cristiano Nicolai [
http://community.jboss.org/people/cristiano.nicolai] created the
discussion
"Re: Process variable and rule task"
To view the discussion, visit:
http://community.jboss.org/message/608222#608222
--------------------------------------------------------------
Francesco,
I'm currently using a ProcessEventListener to insert the process in the working memory
just before it starts and remove it after completed. In this way I can handle processes in
the working memory in a generic way. But a made your suggestion and it works, what happens
is that the process needs to be updated in the working memory after I change a process
variable. Now my listener looks like this and seems to be working fine.
@Override
public void afterVariableChanged(ProcessVariableChangedEvent event) {
LOGGER.debug("{}", event);
LOGGER.debug("Updating ProcessInstance on working memory");
FactHandle handle = event.getKnowledgeRuntime().getFactHandle(
event.getProcessInstance() );
if(handle != null){
event.getKnowledgeRuntime().update( handle,
event.getProcessInstance() );
}
}
Many thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/608222#608222]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]