use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class FlowDiagramService method makeForPhysicalSpecification.
private Long makeForPhysicalSpecification(EntityReference ref, String userId, String providedTitle) {
PhysicalSpecification spec = physicalSpecificationDao.getById(ref.id());
Select<Record1<Long>> logicalFlowSelector = logicalFlowIdSelectorFactory.apply(mkOpts(ref, HierarchyQueryScope.EXACT));
List<LogicalFlow> logicalFlows = logicalFlowDao.findBySelector(logicalFlowSelector);
List<PhysicalFlow> physicalFlows = physicalFlowDao.findBySpecificationId(ref.id());
List<EntityReference> nodes = logicalFlows.stream().flatMap(f -> Stream.of(f.source(), f.target())).distinct().collect(toList());
List<FlowDiagramEntity> entities = ListUtilities.concat(map(logicalFlows, d -> mkDiagramEntity(d)), map(physicalFlows, d -> mkDiagramEntity(d)), newArrayList(mkDiagramEntity(spec)), map(nodes, d -> mkDiagramEntity(d)));
String title = isEmpty(providedTitle) ? spec.name() + " flows" : providedTitle;
return mkNewFlowDiagram(title, userId, entities, emptyList());
}
use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class ChangeLogService method writeChangeLogEntries.
public void writeChangeLogEntries(EntityReference ref, String userId, String postamble, Operation operation) {
switch(ref.kind()) {
case PHYSICAL_FLOW:
PhysicalFlow physicalFlow = physicalFlowDao.getById(ref.id());
writeChangeLogEntries(physicalFlow, userId, postamble, operation);
break;
case LOGICAL_DATA_FLOW:
LogicalFlow logicalFlow = logicalFlowDao.getByFlowId(ref.id());
writeChangeLogEntries(logicalFlow, userId, postamble, operation);
break;
case MEASURABLE_RATING_REPLACEMENT:
MeasurableRatingReplacement measurableRatingReplacement = measurableRatingReplacementdao.getById(ref.id());
writeChangeLogEntries(measurableRatingReplacement, userId, postamble, operation);
break;
case MEASURABLE_RATING_PLANNED_DECOMMISSION:
MeasurableRatingPlannedDecommission measurableRatingPlannedDecommission = measurableRatingPlannedDecommissionDao.getById(ref.id());
writeChangeLogEntries(measurableRatingPlannedDecommission, userId, postamble, operation);
default:
}
}
use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class LogicalFlowDecoratorRatingsCalculator method lookupFlowClassificationRule.
private Optional<Long> lookupFlowClassificationRule(Map<Long, DataType> typesById, Map<Long, LogicalFlow> flowsById, Map<Long, Application> targetAppsById, FlowClassificationRuleResolver resolver, DataTypeDecorator decorator) {
LogicalFlow flow = flowsById.get(decorator.dataFlowId());
EntityReference vantagePoint = lookupVantagePoint(targetAppsById, flow);
EntityReference source = flow.source();
Optional<FlowClassificationRuleVantagePoint> flowClassificationRuleVantagePoint = resolver.resolveAuthSource(vantagePoint, source, decorator.dataTypeId());
return flowClassificationRuleVantagePoint.map(FlowClassificationRuleVantagePoint::ruleId);
}
use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class LogicalFlowDecoratorRatingsCalculator method lookupRating.
private AuthoritativenessRatingValue lookupRating(Map<Long, LogicalFlow> flowsById, Map<Long, Application> targetAppsById, FlowClassificationRuleResolver resolver, DataTypeDecorator decorator) {
LogicalFlow flow = flowsById.get(decorator.dataFlowId());
EntityReference vantagePoint = lookupVantagePoint(targetAppsById, flow);
EntityReference source = flow.source();
return resolver.resolve(vantagePoint, source, decorator.decoratorEntity().id());
}
use of org.finos.waltz.model.logical_flow.LogicalFlow in project waltz by khartec.
the class DataTypeDecoratorService method recalculateDataTypeUsageForApplications.
private void recalculateDataTypeUsageForApplications(EntityReference associatedEntityReference) {
if (LOGICAL_DATA_FLOW.equals(associatedEntityReference.kind())) {
LogicalFlow flow = logicalFlowDao.getByFlowId(associatedEntityReference.id());
dataTypeUsageService.recalculateForApplications(newArrayList(flow.source(), flow.target()));
}
}
Aggregations