View document content by URL

I realized that when searching for the context of a document through API, a URL is returned that downloads the document attached in the process.

How can I make the user first open the document (.pdf for example) and after reading its content decide whether or not to download it? With this, I want to prevent the user from downloading the document whenever he needs to check some information in its content

Document storage URL attached in the process

The document variables present the context information as:

{"doc1": {"id": 7, " processInstanceId ": 6, "name": "doc1", "author": 4, " creationDate ": 1599156529940, " fileName ": "doc_name.pdf", " contentMimeType ":" application / pdf "," contentStorageId ":" 7 "," url ":" documentDownload ? fileName = doc_name.pdf & contentStorageId = 7 "," description ":" "," version ":" 1 "," index ": -1," contentFileName ":" doc_name.pdf "}," doc2 ": null}

The displayed url parameter is used only to download the document:

Documents and memory


How the Bonita Engine, in 7.10.x, manage the memory when it operates with documents?

1/ Widget File Upload => Upload

During this operation, is the complete document is loaded in memory to create a temporary file, or only per packets (10000 char for example)?

2/ Submit the contract

Currently, during the file upload, an ID (temporary file name) is returned. That's means during the Submit contract, there is no memory engage, correct?

3/ in the operation, upload the document

How to get the name of a file uploaded in a document


my process uploads a file (xlsx, csv or txt) via the instantiation form in a document, using the UPLOAD widget.
Let's say, for example, that I select the file "Conso_data_2020_03.xlsx".

The document declared at the pool level is called "myConsoDataFile".

In a process task, I want to copy this file to a different directory than the original one.
To do this, I download the document by applying the following script, found on this forum:

Comment récupérer le nom d'un fichier uploadé dans un document


mon processus charge dans un document, un fichier de données (de type xlsx, csv ou txt) via le formulaire d'instanciation et le widget UPLOAD.
Par exemple, le fichier sélectionné peut s'appeler "conso_data_2020_03.xlsx"

Le document, déclaré au niveau du pool s'appelle lui "fichierDonnees".

Dans une tâche du processus, je souhaite recopier ce fichier dans un autre répertoire que le répertoire d'origine.
Pour ce faire, je download le document en appliquant le script suivant, trouvé sur le forum :

How to change the description of a file?


In my groovy file, I wrote a loop function like below:

Document doc=apiAccessor.getProcessAPI().getDocument(it.id);

request.vendorName+=" description changed";

Invalid initial content for document

Hi, I'm using Bonita Studio Community version 7.8.4.
In a project, I create an instantiation form and it works correctly until I added a document in Data tab and set initial content for it from contract. Just I set initial content for my document variable, below error is showing in validation status or when I run the project:
Invalid initial content for document reqDocument. No FILE contract input has been found.
When I'm going to edit document, file Contract input is cleared! I adding it again but still the problem exist!

How to Handle Documents using Fragments

I have a Custom Fragment where I have Multiple Text Boxes and Drop Downs. Also each row will contain a file Upload Widget. Now Using Buttons , I can add more Items to collection or Remove Items from Collection.
I am able to save the Text Data from Fragment into database but I am confused , how to handle documents this way.
I am aware of handling Documents using Containers and File Upload Widget but that is used only for Documents. In my scenario , I have other input fields and drop downs.

recieve pdf document from an ASP.net API and attach it to a process (version 7.6)


I'm trying to call an ASP.Net API using REST connector that return a pdf file and attach it to a process, the API is tested and works fine off bonita using Postman.

at the connector output operation I added this code :

Get java.io.File from attached document


How can I convert an attached document to a standard Java File type in a Groovy Script Connector?

Thanks in advance.