use of org.finos.waltz.service.measurable.MeasurableService in project waltz by khartec.
the class MeasurableHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
MeasurableIdSelectorFactory factory = new MeasurableIdSelectorFactory();
MeasurableService measurableService = ctx.getBean(MeasurableService.class);
EntityReference ref = mkRef(EntityKind.PERSON, 172272);
IdSelectionOptions options = mkOpts(ref, HierarchyQueryScope.CHILDREN);
Select<Record1<Long>> selector = factory.apply(options);
System.out.println("--selector");
System.out.println(selector);
System.out.println("---");
List<Measurable> measurables = measurableService.findByMeasurableIdSelector(options);
measurables.forEach(System.out::println);
System.out.println("-----");
measurables.stream().filter(m -> OptionalUtilities.contentsEqual(m.id(), 486L)).forEach(System.out::println);
System.out.println(measurables.size());
}
use of org.finos.waltz.service.measurable.MeasurableService in project waltz by khartec.
the class AllocationHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
AllocationSchemeService schemesService = ctx.getBean(AllocationSchemeService.class);
MeasurableService measurableService = ctx.getBean(MeasurableService.class);
MeasurableCategoryDao categoryDao = ctx.getBean(MeasurableCategoryDao.class);
MeasurableRatingService ratingService = ctx.getBean(MeasurableRatingService.class);
ApplicationService applicationService = ctx.getBean(ApplicationService.class);
Tuple4<Application, MeasurableCategory, List<Measurable>, AllocationScheme> stuff = setup(dsl, schemesService, measurableService, categoryDao, applicationService);
addRating(ratingService, stuff, 0);
addRating(ratingService, stuff, 1);
// addRating(ratingService, stuff, 2);
// addAllocation(dsl, stuff, 0, 50);
addAllocation(dsl, stuff, 1, 20);
Long measurableCategory = stuff.v2.id().get();
dumpRatings(dsl, stuff.v4);
dumpAllocs(dsl, stuff.v4);
doDiff(dsl, measurableCategory);
System.out.println(ratingService.findByCategory(measurableCategory));
}
Aggregations