unexecutedCommands = new HashSet<Integer>();
List<Command> commandsToExecute = new ArrayList<Command>(updateCommands.size());
// Find the commands to be executed
for (int i = 0; i < updateCommands.size(); i++) {
Command updateCommand = (Command)updateCommands.get(i).clone();
CommandContext context = this.getContext();
if (this.contexts != null && !this.contexts.isEmpty()) {
context = context.clone();
context.setVariableContext(this.contexts.get(i));
}
boolean needProcessing = false;
if(shouldEvaluate != null && shouldEvaluate.get(i)) {
updateCommand = (Command) updateCommand.clone();
Evaluator eval = getEvaluator(Collections.emptyMap());
eval.initialize(context, getDataManager());
AccessNode.rewriteAndEvaluate(updateCommand, eval, context, context.getMetadata());
}
needProcessing = RelationalNodeUtil.shouldExecute(updateCommand, true);
if (needProcessing) {
commandsToExecute.add(updateCommand);
} else {