use of com.khartec.waltz.model.IdSelectionOptions in project waltz by khartec.
the class ApplicationIdSelectorHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
ApplicationIdSelectorFactory factory = ctx.getBean(ApplicationIdSelectorFactory.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
ApplicationService applicationService = ctx.getBean(ApplicationService.class);
IdSelectionOptions options = IdSelectionOptions.mkOpts(EntityReference.mkRef(EntityKind.MEASURABLE, 1L), HierarchyQueryScope.EXACT);
Select<Record1<Long>> selector = factory.apply(options);
System.out.println(selector);
List<Application> apps = applicationService.findByAppIdSelector(options);
System.out.println("--- sz: " + apps.size());
apps.forEach(System.out::println);
System.out.println("--- done");
}
use of com.khartec.waltz.model.IdSelectionOptions in project waltz by khartec.
the class LogicalFlowHarness method main.
public static void main(String[] args) throws ParseException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
LogicalFlowDao dao = ctx.getBean(LogicalFlowDao.class);
ApplicationIdSelectorFactory factory = ctx.getBean(ApplicationIdSelectorFactory.class);
IdSelectionOptions options = IdSelectionOptions.mkOpts(mkRef(EntityKind.ORG_UNIT, 20), HierarchyQueryScope.CHILDREN);
LogicalFlow app2appFlow = dao.findByFlowId(28940);
LogicalFlow app2actorFlow = dao.findByFlowId(28941);
System.out.println("-- App 2 App");
System.out.println(app2appFlow);
System.out.println("-- App 2 Actor");
System.out.println(app2actorFlow);
List<LogicalFlow> flows = dao.findByEntityReference(mkRef(EntityKind.APPLICATION, 22406));
System.out.println("-- flows");
flows.forEach(System.out::println);
}
use of com.khartec.waltz.model.IdSelectionOptions in project waltz by khartec.
the class MeasurableHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
MeasurableIdSelectorFactory factory = ctx.getBean(MeasurableIdSelectorFactory.class);
MeasurableService measurableService = ctx.getBean(MeasurableService.class);
EntityReference ref = mkRef(EntityKind.FLOW_DIAGRAM, 2);
IdSelectionOptions options = mkOpts(ref, HierarchyQueryScope.EXACT);
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("-----");
}
use of com.khartec.waltz.model.IdSelectionOptions in project waltz by khartec.
the class EntityStatisticEndpoint method calculateHistoricStatTallyRoute.
private List<TallyPack<String>> calculateHistoricStatTallyRoute(Request request, Response response) throws IOException {
IdSelectionOptions idSelectionOptions = readIdSelectionOptionsFromBody(request);
RollupKind rollupKind = extractRollupKind(request);
Duration duration = EnumUtilities.readEnum(request.queryParams("duration"), Duration.class, s -> Duration.MONTH);
Long statisticId = getId(request);
return entityStatisticService.calculateHistoricStatTally(statisticId, rollupKind, idSelectionOptions, duration);
}
use of com.khartec.waltz.model.IdSelectionOptions in project waltz by khartec.
the class EntityStatisticEndpoint method calculateStatTallyRoute.
private TallyPack<String> calculateStatTallyRoute(Request request, Response response) throws IOException {
IdSelectionOptions idSelectionOptions = readIdSelectionOptionsFromBody(request);
RollupKind rollupKind = extractRollupKind(request);
Long statisticId = getId(request);
return entityStatisticService.calculateStatTally(statisticId, rollupKind, idSelectionOptions);
}
Aggregations