use of org.finos.waltz.model.change_initiative.ChangeInitiativeKind in project waltz by khartec.
the class ChangeInitiativeGenerator method createCiRecords.
private List<ChangeInitiativeRecord> createCiRecords(List<Long> ouIds) {
AtomicLong idCtr = new AtomicLong();
return IntStream.range(0, NUM_CHANGE_INITIATIVES).boxed().flatMap(i -> {
long initiativeId = idCtr.incrementAndGet();
Tuple4<Long, ChangeInitiativeKind, Long, String> initiative = tuple(initiativeId, INITIATIVE, null, mkName());
Stream<Tuple4<Long, ChangeInitiativeKind, Long, String>> children = IntStream.range(0, RND.nextInt(4)).boxed().flatMap(x -> {
long programmeId = idCtr.incrementAndGet();
Stream<Tuple4<Long, ChangeInitiativeKind, Long, String>> programmes = Stream.of(tuple(programmeId, PROGRAMME, initiativeId, mkName()));
Stream<Tuple4<Long, ChangeInitiativeKind, Long, String>> projects = IntStream.range(0, RND.nextInt(4)).boxed().map(y -> tuple(idCtr.incrementAndGet(), PROJECT, programmeId, mkName()));
return Stream.concat(programmes, projects);
});
return Stream.concat(Stream.of(initiative), children);
}).map(t -> buildChangeInitiativeRecord(t, ouIds)).collect(toList());
}
Aggregations