+ /**
+ * Copy validation cycles from study to study.
+ *
+ * @param fromStudy
+ * the source study
+ * @param toStudy
+ * the destination study
+ */
+ private void copyValidationCycles(final Study fromStudy, final Study toStudy) {
+ for (ValidationCycle fromCycle : fromStudy.getValidationCycles()
+ .values()) {
+ if (fromCycle.isAssigned()) {
+ ValidationCycle cycle = fromCycle.clone(toStudy);
+ getValidationCycleDAO().create(cycle);
+ toStudy.addRelation(cycle.getContext());
+ toStudy.getValidationCycles().put(
+ cycle.getDocumentType().getName(), cycle); // Replaces the cycle if exists as default,
+ }
+ }
+ }
+