JBoss Community

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

reply from HuiSheng Xu in jBPM - View the full discussion

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

Start a new discussion in jBPM at Community