if (externalUnitBean.getUnitType() == PartyTypeEnum.DEPARTMENT) {
return DepartmentUnit.createNewOfficialExternalDepartmentUnit(externalUnitBean.getUnitName(),
externalUnitBean.getUnitCode(), externalUnitBean.getParentUnit());
} else {
return new CreateUnit().run(externalUnitBean.getParentUnit(), new MultiLanguageString(Locale.getDefault(),
externalUnitBean.getUnitName()), null, null, externalUnitBean.getUnitCode(), new YearMonthDay(), null,
externalUnitBean.getUnitType(), null, null, null, null, null, null, null, null);
}
}