@Override
public void run() {
// Can't use iterator in loop because it may cause
// ConcurrentModificationException
List<Step> list = batch.getSteps();
Step step = null;
// DBA.
// we need to enable the action button before executing the stp
// otherthise the stop button doesn't be enabled
StateMachine.getInstance().transitionTo(modelExecutor.getSuccessState()); // need
// to
// be
// validating
for (int i = 0; i < list.size(); i++) {
step = list.get(i);
try {
// if stop is requested : we stop execution of batch
if (!isStopRequested()) {
executeStep(step);
} else {
try {
step.getFlow().setDirector(null);
} catch (Exception e) {
e.printStackTrace();
}
// when stop batch execution is requested we reset the
// running index and boolean stopRequested