use of org.olat.course.assessment.EfficiencyStatementEvent in project openolat by klemens.
the class UpdateEfficiencyStatementsWorker method run.
/**
* @see java.lang.Runnable#run()
*/
public void run() {
boolean success = false;
try {
RepositoryManager rm = CoreSpringFactory.getImpl(RepositoryManager.class);
EfficiencyStatementManager esm = CoreSpringFactory.getImpl(EfficiencyStatementManager.class);
RepositoryEntry re = rm.lookupRepositoryEntry(ores, false);
List<Identity> identities = esm.findIdentitiesWithEfficiencyStatements(re.getKey());
esm.updateEfficiencyStatements(re, identities);
// close db session in this thread
DBFactory.getInstance().commitAndCloseSession();
success = true;
EfficiencyStatementEvent finishedEvent = new EfficiencyStatementEvent(EfficiencyStatementEvent.CMD_FINISHED, ores.getResourceableId());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(finishedEvent, ores);
} catch (Exception ex) {
log.error("Unexpected exception updating the efficiency statements of " + ores, ex);
} finally {
// close db session in this thread
if (!success) {
DBFactory.getInstance().rollbackAndCloseSession();
}
}
}
use of org.olat.course.assessment.EfficiencyStatementEvent in project OpenOLAT by OpenOLAT.
the class UpdateEfficiencyStatementsWorker method run.
/**
* @see java.lang.Runnable#run()
*/
public void run() {
boolean success = false;
try {
RepositoryManager rm = CoreSpringFactory.getImpl(RepositoryManager.class);
EfficiencyStatementManager esm = CoreSpringFactory.getImpl(EfficiencyStatementManager.class);
RepositoryEntry re = rm.lookupRepositoryEntry(ores, false);
List<Identity> identities = esm.findIdentitiesWithEfficiencyStatements(re.getKey());
esm.updateEfficiencyStatements(re, identities);
// close db session in this thread
DBFactory.getInstance().commitAndCloseSession();
success = true;
EfficiencyStatementEvent finishedEvent = new EfficiencyStatementEvent(EfficiencyStatementEvent.CMD_FINISHED, ores.getResourceableId());
CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(finishedEvent, ores);
} catch (Exception ex) {
log.error("Unexpected exception updating the efficiency statements of " + ores, ex);
} finally {
// close db session in this thread
if (!success) {
DBFactory.getInstance().rollbackAndCloseSession();
}
}
}
Aggregations