in ddm-rrm-business-process-management/src/main/java/com/epam/digital/data/platform/management/service/impl/BusinessProcessServiceImpl.java [107:130]
public void updateProcess(String content, String processName, String versionName, String eTag) {
var repo =
versionContextComponentManager.getComponent(versionName, VersionedFileRepository.class);
String processPath = getProcessPath(processName);
var time = LocalDateTime.now();
FileDatesDto fileDatesDto = FileDatesDto.builder().build();
if (repo.isFileExists(processPath)) {
String oldContent = repo.readFile(processPath);
//ignore update if difference only in modified date
if (StringsComparisonUtils.compareIgnoringSubstring(
oldContent, content,
"rrm:modified=\"",
"Z\"")) {
return;
}
fileDatesDto = getDatesFromContent(oldContent);
}
if (fileDatesDto.getCreate() == null) {
var repoDates = repo.getVersionedFileDates(processPath);
fileDatesDto.setCreate(Objects.isNull(repoDates) ? time : repoDates.getCreated());
}
content = addDatesToContent(content, fileDatesDto.getCreate(), time);
repo.writeFile(processPath, content, eTag);
}