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.