Search in sources :

Example 1 with LogicalFlowDao

use of com.khartec.waltz.data.logical_flow.LogicalFlowDao in project waltz by khartec.

the class FlowLineageHarness method main.

public static void main(String[] args) throws ParseException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);
    LogicalFlowDao flowDao = ctx.getBean(LogicalFlowDao.class);
    EntityReference ref1 = mkRef(APPLICATION, 25662);
    EntityReference ref2 = mkRef(ACTOR, 10);
    EntityReference ref3 = mkRef(APPLICATION, 25612);
    findIncomingByRefs(dsl, SetUtilities.fromArray(ref1, ref2, ref3));
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) EntityReference(com.khartec.waltz.model.EntityReference) DSLContext(org.jooq.DSLContext) LogicalFlowDao(com.khartec.waltz.data.logical_flow.LogicalFlowDao)

Example 2 with LogicalFlowDao

use of com.khartec.waltz.data.logical_flow.LogicalFlowDao 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);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) LogicalFlow(com.khartec.waltz.model.logical_flow.LogicalFlow) ApplicationIdSelectorFactory(com.khartec.waltz.data.application.ApplicationIdSelectorFactory) DSLContext(org.jooq.DSLContext) LogicalFlowDao(com.khartec.waltz.data.logical_flow.LogicalFlowDao) IdSelectionOptions(com.khartec.waltz.model.IdSelectionOptions)

Example 3 with LogicalFlowDao

use of com.khartec.waltz.data.logical_flow.LogicalFlowDao 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 = ctx.getBean(LogicalFlowIdSelectorFactory.class);
    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());
}
Also used : LogicalFlowIdSelectorFactory(com.khartec.waltz.data.logical_flow.LogicalFlowIdSelectorFactory) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) LogicalFlowService(com.khartec.waltz.service.logical_flow.LogicalFlowService) LogicalFlow(com.khartec.waltz.model.logical_flow.LogicalFlow) EntityReference(com.khartec.waltz.model.EntityReference) DSLContext(org.jooq.DSLContext) LogicalFlowDao(com.khartec.waltz.data.logical_flow.LogicalFlowDao) IdSelectionOptions(com.khartec.waltz.model.IdSelectionOptions) Record1(org.jooq.Record1)

Aggregations

LogicalFlowDao (com.khartec.waltz.data.logical_flow.LogicalFlowDao)3 DSLContext (org.jooq.DSLContext)3 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)3 EntityReference (com.khartec.waltz.model.EntityReference)2 IdSelectionOptions (com.khartec.waltz.model.IdSelectionOptions)2 LogicalFlow (com.khartec.waltz.model.logical_flow.LogicalFlow)2 ApplicationIdSelectorFactory (com.khartec.waltz.data.application.ApplicationIdSelectorFactory)1 LogicalFlowIdSelectorFactory (com.khartec.waltz.data.logical_flow.LogicalFlowIdSelectorFactory)1 LogicalFlowService (com.khartec.waltz.service.logical_flow.LogicalFlowService)1 Record1 (org.jooq.Record1)1