use of com.khartec.waltz.data.application.ApplicationIdSelectorFactory 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.data.application.ApplicationIdSelectorFactory in project waltz by khartec.
the class AssetCostHarness method main.
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
AssetCostService service = ctx.getBean(AssetCostService.class);
AssetCostStatsDao statsDao = ctx.getBean(AssetCostStatsDao.class);
AssetCostDao costDao = ctx.getBean(AssetCostDao.class);
ApplicationIdSelectorFactory selectorFactory = ctx.getBean(ApplicationIdSelectorFactory.class);
long st = System.currentTimeMillis();
System.out.println("-- start");
IdSelectionOptions appIdSelectionOptions = ImmutableIdSelectionOptions.builder().scope(HierarchyQueryScope.CHILDREN).entityReference(ImmutableEntityReference.builder().id(5600).kind(EntityKind.ORG_UNIT).build()).build();
List<Tuple2<Long, BigDecimal>> costs = service.calculateCombinedAmountsForSelector(appIdSelectionOptions);
System.out.println("-- end, dur: " + (System.currentTimeMillis() - st));
System.out.println(costs);
System.out.println(costs.size());
}
use of com.khartec.waltz.data.application.ApplicationIdSelectorFactory 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);
}
Aggregations