Iterator it = tareas.iterator();
while (it.hasNext()) {
Tarea tarea = (Tarea) it.next();
if (fromState.equals(tarea.getEstado())){
tarea.setEstado(toState);
UpdateEntityService entityService = new UpdateEntityService();
Map params = new HashMap();
params.put(ParamsConst.ENTITY, tarea);
try {
entityService.execute(params);
} catch (Exception e) {
logger.error(Tools.getStackTrace(e));
}
}
}