use of org.finos.waltz.service.rating_scheme.RatingSchemeService in project waltz by khartec.
the class AssessmentGenerator method getOrCreateRatingScheme.
private RatingScheme getOrCreateRatingScheme(ApplicationContext ctx, String name, Tuple3<String, String, String>... options) {
DSLContext dsl = getDsl(ctx);
Long schemeId = dsl.select(RATING_SCHEME.ID).from(RATING_SCHEME).where(RATING_SCHEME.NAME.eq(name)).fetchOne(RATING_SCHEME.ID);
if (schemeId == null) {
schemeId = createRatingScheme(dsl, name, options);
}
RatingSchemeService ratingSchemeService = ctx.getBean(RatingSchemeService.class);
return ratingSchemeService.getById(schemeId);
}
Aggregations