Comment garder le document initialement attache au file upload widget dans le draft d'un formulaire

1
0
-1

Bonjour,

J'ai une question sur le widget d'upload de fichier dans mon formulaire.

J'utilise la fonction Draft (https://documentation.bonitasoft.com/bonita/2021.1/widgets#_save_button_...) et l'utilisateur peut bien enregistrer ce formulaire en "brouillon" afin de pouvoir y revenir pour le valider plus tard.
Mais je rencontre un problème avec le widget d'upload.

En effet, j'aimerai que le formulaire ait conservé l'upload du fichier réalisé initialement par l'utilisateur.
Mais lorsque l'utilisateur ouvre le formulaire qui est au statut "Brouillon", la pièce-jointe initialement uploadée est vide.

Est ce techniquement possible de conserver la pièce-jointe dans la version draft de mon formulaire et l'afficher dans mon widget d'upload?

Sinon, y a-t-il une solution de contournement ?

Merci d'avance de votre aide,
Marielle

2 answers

1
0
-1
This one is the BEST answer!

Hello,

another idea that looks less like a work around,

would be to just have Repeat Task with repeat condition = "repeat until user click on terminate task"

the form would be a basic one with 2 different submit buttons:

- one Standard button with label "Save draft", that will submit the task with a flag "terminate=false"
- one Standard button with label "Terminate task", that will submit the task with a flag "terminate=true"

this solution does not use the save draft button anymore, and everything is saved server side. The task is just always available in your task list until you click on Terminate task.

It is maybe more simple to implement,

Julien.

1
0
-1

Hello,

it looks like the problem is due to the fact that the file upload saves the content of your file in a temp folder server side. So if the user saves his form, then logout, the temp folder is cleaned. Then when the user login again the form inputs are restored, but the temporary uploaded file does not exist anymore.

  • if you do not want to create another complicated Custom widget, you can imagine to replace the upload widget of the form, by a [input Text (readOnly)] + [OpenModal button].
    This button would open a modal containing an [upload widget] + [Submit button]. this submit is linked to an AddDocument task.
    The [input Text (readOnly)] is just here to display the name of the last updated file.

don't know if this solution could work in your use case?
Hope this helps,
Julien.

Notifications