[jboss-user] [jBPM] - Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()

HuiSheng Xu do-not-reply at jboss.com
Tue Jul 6 16:55:16 EDT 2010


HuiSheng Xu [http://community.jboss.org/people/rebody] replied to the discussion

"Bug: jPBM 4.4: JbpmException thrown by ActivityExecution.getActivity()"

To view the discussion, visit: http://community.jboss.org/message/551345#551345

--------------------------------------------------------------
Hi Joe,

Yes, you are right.  The EnvironmentFactory isn't a part of public api.  So if we want to get access environment,  the recommanded way is using Command.  As followed:

processEngine.execute(new Command() {
    public Object execute(Environment env) {
        // do something.
        return null;
    }
});


And yes,  the Environment interface didn't declared close() method,  because we didn't need it.  The EnvironmentInterceptor will open/close the Environment instance automaticly.

At last, if you want to do something transactional,  please use Command to replace 'EnvironmentFactory.openEnvironment()',  EnvironmentFactory wouldn't manage transaction,  so it could cause some transactional issues.

Cheers.  :) 

--------------------------------------------------------------

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

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/20100706/c7dde5c3/attachment.html 


More information about the jboss-user mailing list