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]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to