[jboss-user] [jBPM] - Re: Process variable and rule task

Cristiano Nicolai do-not-reply at jboss.com
Thu Jun 2 02:56:07 EDT 2011


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&containerType=14&container=2034]

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


More information about the jboss-user mailing list