kitodo / kitodo-production

Kitodo.Production is a workflow management tool for mass digitization and is part of the Kitodo Digital Library Suite.
http://www.kitodo.org/software/kitodoproduction/
GNU General Public License v3.0
63 stars 63 forks source link

Misleading error message if workflow BPNM file cannot be read #4219

Open matthias-ronge opened 3 years ago

matthias-ronge commented 3 years ago

For some reason, Production wants to save the workflow BPNM diagram when you’re adding a process template. This is unnecessary overhead and leads to errors in case the file is not present. If the BPNM file isn’t readable during process template creation, there is a misleading error message that the file cannot be written.

Screenshot

Stack trace:

[ERROR] 2021-02-26 11:07:24.711 [http-nio-8080-exec-2] TemplateForm - errorDiagram
java.io.FileNotFoundException: D:\Daten\Production_3\diagrams\Example_Workflow.bpmn20.xml (Das System kann den angegebenen Pfad nicht finden)
    at java.net.URL.openStream(URL.java:1068) ~[?:1.8.0_282]
    at org.kitodo.filemanagement.FileManagement.read(FileManagement.java:87) ~[kitodo-file-management-3.2.1-SNAPSHOT.jar:?]
    at org.kitodo.production.services.file.FileService.read(FileService.java:323) ~[classes/:3.2.1-SNAPSHOT]
    at org.kitodo.production.workflow.model.Reader.<init>(Reader.java:54) ~[classes/:3.2.1-SNAPSHOT]
    at org.kitodo.production.workflow.model.Converter.<init>(Converter.java:50) ~[classes/:3.2.1-SNAPSHOT]
    at org.kitodo.production.forms.TemplateForm.prepareTasks(TemplateForm.java:400) ~[classes/:3.2.1-SNAPSHOT]
    at org.kitodo.production.forms.TemplateForm.save(TemplateForm.java:130) [classes/:3.2.1-SNAPSHOT]

Goal: Do not save workflow file when adding process template. Replace error message: File cannot be read

solth commented 3 years ago

The stacktrace suggest that the system does not try to save the BPNM workflow file, but rather just read it (which makes sense, since the template tasks are created from the individual workflow steps).

So I guess the problem lies rather in the wrong error message being displayed ("Fehler beim Speichern..." instead of "Fehler beim Öffnen...") than actually trying to save the workflow xml file.

matthias-ronge commented 1 year ago

The stacktrace suggest that the system does not try to save the BPNM workflow file, but rather just read it (which makes sense, since the template tasks are created from the individual workflow steps).

So I guess the problem lies rather in the wrong error message being displayed ("Fehler beim Speichern..." instead of "Fehler beim Öffnen...") than actually trying to save the workflow xml file.

I just thought the same