use of org.finos.waltz.service.logical_flow.LogicalFlowService in project waltz by khartec.
the class DiagramToDotExport method main.
public static void main(String[] args) throws IOException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
FlowDiagramService flowDiagramService = ctx.getBean(FlowDiagramService.class);
FlowDiagramEntityService flowDiagramEntityService = ctx.getBean(FlowDiagramEntityService.class);
ApplicationService applicationService = ctx.getBean(ApplicationService.class);
LogicalFlowService logicalFlowService = ctx.getBean(LogicalFlowService.class);
EntityReference diagRef = mkRef(EntityKind.FLOW_DIAGRAM, 1L);
IdSelectionOptions options = IdSelectionOptions.mkOpts(diagRef, HierarchyQueryScope.EXACT);
List<Application> apps = applicationService.findByAppIdSelector(options);
List<LogicalFlow> flows = logicalFlowService.findBySelector(options);
Map<Long, Application> appsById = indexBy(a -> a.id().get(), apps);
System.out.println("------");
String digraph = String.format("digraph G { %s %s}", renderApplications(apps), renderFlows(flows, appsById));
System.out.println(digraph);
System.out.println("-----");
/*
digraph G {
"Welcome" -> "To"
"To" -> "Web"
"To" -> "GraphViz!"
}
*/
}
use of org.finos.waltz.service.logical_flow.LogicalFlowService 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);
LogicalFlowService service = ctx.getBean(LogicalFlowService.class);
ApplicationIdSelectorFactory factory = new ApplicationIdSelectorFactory();
IdSelectionOptions options = IdSelectionOptions.mkOpts(mkRef(EntityKind.PERSON, 262508), HierarchyQueryScope.CHILDREN);
for (int i = 0; i < 5; i++) {
List<LogicalFlow> flows = FunctionUtilities.time("Get flows", () -> service.findBySelector(options));
}
}
use of org.finos.waltz.service.logical_flow.LogicalFlowService in project waltz by khartec.
the class DataFlowHarness method main.
public static void main(String[] args) throws ParseException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
LogicalFlowService service = ctx.getBean(LogicalFlowService.class);
LogicalFlowDao dao = ctx.getBean(LogicalFlowDao.class);
LogicalFlowIdSelectorFactory factory = new LogicalFlowIdSelectorFactory();
IdSelectionOptions options = IdSelectionOptions.mkOpts(EntityReference.mkRef(EntityKind.ORG_UNIT, 5000), HierarchyQueryScope.CHILDREN);
Select<Record1<Long>> selector = factory.apply(options);
System.out.println(selector);
List<LogicalFlow> flows = dao.findBySelector(selector);
flows.forEach(System.out::println);
// by data type
EntityReference dataType = EntityReference.mkRef(EntityKind.DATA_TYPE, 6000);
IdSelectionOptions dataTypeOptions = IdSelectionOptions.mkOpts(dataType, HierarchyQueryScope.CHILDREN);
List<LogicalFlow> byDataTypeFlows = service.findBySelector(dataTypeOptions);
byDataTypeFlows.forEach(System.out::println);
System.out.println(byDataTypeFlows.size());
}
Aggregations