package pt.utl.ist.scripts.runOnce.degreeStructure;

import net.sourceforge.fenixedu.domain.Department;
import pt.utl.ist.scripts.commons.AtomicScript;

public class UpdateDepartmentNames extends AtomicScript {

    public static void main(String[] args) {
        logger.info("Starting the process...");
        processWriteTransaction(new UpdateDepartmentNames());
        logger.info("Process finalized");
        System.exit(0);

    }

    @Override
    protected void run() throws Exception {
        for (Department department : rootDomainObject.getDepartmentsSet()) {
            department.setName(department.getDepartmentUnit().getName());
            System.out.println("DEPARTAMENNTO: " + department.getName());
        }
        System.out.println("DONE");
    }

}
