Community

JBPM4.3 Variable History

reply from Huisheng Xu in jBPM - View the full discussion

Hi Khaled,

  If you want to store the created variable, you should put the codes into transaction. So Whether you open a Environment or put all of function into a Command.

 

  open environment:

 

EnvironmentImpl environment = ((EnvironmentFactory) processEngine).openEnvironment();

try {

  // create variable

} finally {

    environment.close();
}

 

  using Command:

 

processEngine.execute(new Command() {

    public Object execute(Environment env) {

        // create variable
    }

});

 

  Furthermore, if you let spring to manage the transaction for jBPM4, you needn't do like above.

Reply to this message by going to Community

Start a new discussion in jBPM at Community