use of org.finos.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.
the class LogicalFlowService method addFlows.
public List<LogicalFlow> addFlows(List<AddLogicalFlowCommand> addCmds, String username) {
addCmds.forEach(this::rejectIfSelfLoop);
Set<AddLogicalFlowCommand> toAdd = fromCollection(addCmds);
List<ChangeLog> logEntries = toAdd.stream().flatMap(cmd -> {
ImmutableChangeLog addedSourceParent = ImmutableChangeLog.builder().parentReference(cmd.source()).severity(Severity.INFORMATION).userId(username).message(format("Flow %s between: %s and %s", "added", cmd.source().name().orElse(Long.toString(cmd.source().id())), cmd.target().name().orElse(Long.toString(cmd.target().id())))).childKind(LOGICAL_DATA_FLOW).operation(Operation.ADD).build();
ImmutableChangeLog addedTargetParent = addedSourceParent.withParentReference(cmd.target());
return Stream.of(addedSourceParent, addedTargetParent);
}).collect(Collectors.toList());
changeLogService.write(logEntries);
LocalDateTime now = nowUtc();
List<LogicalFlow> flowsToAdd = toAdd.stream().map(addCmd -> ImmutableLogicalFlow.builder().source(addCmd.source()).target(addCmd.target()).lastUpdatedAt(now).lastUpdatedBy(username).created(UserTimestamp.mkForUser(username, now)).provenance("waltz").build()).collect(toList());
return logicalFlowDao.addFlows(flowsToAdd, username);
}
use of org.finos.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.
the class MeasurableRelationshipService method writeLog.
private void writeLog(Operation op, EntityReference a, String message, String username) {
ImmutableChangeLog logEntry = ImmutableChangeLog.builder().severity(Severity.INFORMATION).operation(op).parentReference(a).userId(username).message(message).build();
changeLogService.write(logEntry);
}
use of org.finos.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.
the class DataTypeDecoratorService method audit.
private void audit(String message, EntityReference entityReference, String username) {
ImmutableChangeLog logEntry = ImmutableChangeLog.builder().parentReference(entityReference).userId(username).severity(Severity.INFORMATION).message(message).childKind(EntityKind.DATA_TYPE).operation(Operation.UPDATE).build();
changeLogService.write(logEntry);
}
use of org.finos.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.
the class PhysicalFlowParticipantService method auditChange.
private void auditChange(String message, EntityReference ref, String username, Operation operation) {
ImmutableChangeLog logEntry = ImmutableChangeLog.builder().parentReference(ref).severity(Severity.INFORMATION).userId(username).message(message).operation(operation).build();
changeLogService.write(logEntry);
}
use of org.finos.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.
the class ThumbnailService method auditChange.
private void auditChange(String verb, EntityReference parentRef, String username, Operation operation) {
ImmutableChangeLog logEntry = ImmutableChangeLog.builder().parentReference(parentRef).severity(Severity.INFORMATION).userId(username).message(format("Thumbnail %s", verb)).childKind(parentRef.kind()).operation(operation).build();
changeLogService.write(logEntry);
}
Aggregations