Skip to content

Commit

Permalink
Preserve workflow SVG if no changes are transmitted
Browse files Browse the repository at this point in the history
  • Loading branch information
BartChris committed Nov 5, 2024
1 parent 3d32ea1 commit 3828ab6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ private boolean saveFiles() throws IOException, WorkflowException {

xmlDiagram = requestParameterMap.get("editForm:workflowTabView:xmlDiagram");
if (Objects.nonNull(xmlDiagram)) {
svgDiagram = StringUtils.substringAfter(xmlDiagram, "kitodo-diagram-separator");
xmlDiagram = StringUtils.substringBefore(xmlDiagram, "kitodo-diagram-separator");
if (xmlDiagram.contains("kitodo-diagram-separator")) {
svgDiagram = StringUtils.substringAfter(xmlDiagram, "kitodo-diagram-separator");
xmlDiagram = StringUtils.substringBefore(xmlDiagram, "kitodo-diagram-separator");
}

Reader reader = new Reader(new ByteArrayInputStream(xmlDiagram.getBytes(StandardCharsets.UTF_8)));
reader.validateWorkflowTasks();
Expand Down

0 comments on commit 3828ab6

Please sign in to comment.