How to modify document list content

1
0
-1

Hi,
Can you help me? (I'm using Bonita Community 7.2)

I've a process involving various steps:
RANF.png

From Instantiation form I acquire Model Contract and a variable list of files as attached documents via upload widget:
UI-ATTACHMENT.png
Please note that some file are mandatory and some optional!

My Process Instantiation Inputs are:
PROCESS-INSTANTIATION-INPUTS.png
Please note: "allegatiRANFInputs" type FILE is "MULTIPLE"!!!

Where my Pool variables are:
POOL-VARIABLES.png

And my Documents are:
DOCUMENTS.png
Defined as follow:
ALLEGATIRANF-DEFINITION.png
Please note "Initial content->From contract".

This is my "formOutput.allegatiRANFInput" with 3 attachment (2 mandatory and 1 optional) before submit in JSON format:
allegatiRANFInput-JSON.png

This is H2 bonita_journal.db content after submit:
H2-DOCUMENT.png
H2-DOCUMENT-MAPPING.png

Now, in a subsequent human task: "Modifica la richiesta rifiutata", I need to present to user the list of previously attached files (done via a check list) and the user must have the choice to change some of them. The "Task Inputs" are:
- richiestaANFInput:COMPLEX
- allegatiRANFInput:FILE:MULTIPLE

I have:
allegatiRANF_ref.png

That I show to user as follow:
MODRANF.png

If user uncheck the checkbox from existing attachment then it can be upload as new file:
MODRANF2.png

Then user will upload only the removed mandatory document and in formOutput.allegatiRANFInput' I have:
allegatiRANFInputMOD.png

Now if in the operation pane of human task if I use the default operation "Set document list":
allegatiRANF_set_document_list.png

It works but I lost the 2 existing documents (that user do not want do modify and that do not upload again) and list was updated and contain only with the new uploaded document.

So I removed the previous op. "Set documetn list" and I defined a fake string variable "aggiornaATTACH" that take values "":
aggiornaATTACH.png

from the following script:
aggiornaATTACH-SCRIPT.png
But does not work!

Which is the correct way to "update document list" in bonita without removing existing ones?

Thanks

1 answer

1
0
-1

I found the solution to my problem!
In the "Operations" of "Execution" of "Modifica la richiesta rifiutata" human task i use the "Set document list" as follow:
SOLUTION-SETDOCUMENTLIST.png

The associated groovy script is this:
SOLUTION-GROOVY-2.png

P.S.: Please note that old files are still in the Bonita Journal:
BONITA-JOURNAL.png
Bye

Notifications