public class AddShiftsToSchoolClass {
@Atomic
public static void run(InfoClass infoClass, List<String> shiftOIDs) throws FenixServiceException {
check(RolePredicates.RESOURCE_ALLOCATION_MANAGER_PREDICATE);
final SchoolClass schoolClass = FenixFramework.getDomainObject(infoClass.getExternalId());
if (schoolClass == null) {
throw new InvalidArgumentsServiceException();
}
for (final String shiftOID : shiftOIDs) {
final Shift shift = FenixFramework.getDomainObject(shiftOID);
if (shift == null) {
throw new InvalidArgumentsServiceException();
}
schoolClass.associateShift(shift);
}
}