Groovy connector file reading script returns null

Hello, I created a groovy script connector in order to read a CSV file.
With a local file, I can get the result without error; however, I could not read the CSV file with document url as follows. The url is correct and tested already.
It returns null.
Would you someone know the reason why? The filename in the script is not valid?

Any help would be appreciated.
Thanks in advanced.

//def fileName= "D:/BonitaAddOns/csv/testFile.csv"
def fileName= "/bonita/portal/"+ csvObjVar.docUrl

How to Convert DocumentValue into File (DataType) in Groovy Script

Hello every body,

I trying post form-data (multipart with some files and some part) during the process.
I know how to convert document into documentValue but i need convert documentValue into File.
How can I do that?

Thanks a lot.

How to show a Sample Document as a Downloadable link in an Application Page

I need to implement a scenario where the user can download a sample Document and then fill out the document and upload again.
I am stuck in the part where the sample document can be provided.
The page is an Application page . We use the Page to start a Process instance.
The document should be visible as a Downloadable link to the user.
When the User clicks on the Document link, the sample document is downloaded on the users computer.

What are the possible ways to do that ?

update document via groovy script

Hi, I have a given path to a document, and I need to update a document variable in the process with that document (the document path depends on every case). Also I need to place that document in another path when the process finishes. I need to do this in groovy scripts. and I have no idea how to up/download documents in bonita scripts

Best reagards

Need to display a document download url and the author as well

I am using Bonita Subscription 7.1.2 .
I have a task where multiple approvers will review a task and attach a document each.
The requestor will be able to see the final status after all review is complete.
The requestor should be able to see the documents that the approvers have attached.
I was able to do that , but currently there is a list of all document url/links available.
To make more sense out of it, I need to display the approver name beside the document so that the requestor is able to identify which approver has attached which document.

Unresolved dependency for the filename variable expression of

Hi ,

i have created a string variable, inside it i have implemented a groovy code like this:

import org.bonitasoft.engine.bpm.document.Document;

 apiAccessor.getProcessAPI().getLastDocument(processInstanceId, "attachedDoc").getContentFileName();

This code permit to get the filename of attached, but when i try to run the workflow, it shown me this warning:

Unresolved dependency for the filename variable expression of

What does it mean?

How i can get an id of attached docuement?


When a user attached a document, automatically the file data will be registred into database with an unique id, so how i can retrieve this unique id?

Many thanks!!.

How i can handly a document inside bonita work flow?

Hi, everybody,

I have a simple work flow that it has only one human task. This human task contains a form with a attached widged. I have done a lot of questiosn about this issue, but i haven't gotten any clear response.

The question is very simple, and it is the follows:

  • When i have attached a document, where exactly it saves?
  • How i can change the default directory by another directory?
  • How i can get the filename ?

Many Thanks!!

Handle document list (delete / add) with 7.2


I have a process with a document list. The document list is created on the instantiaction form.

In one of the human tasks a user should be able to view / add / delete his documents. I first changed formInput to a Javascript expression to get the documents from the context (and other REST API variables):

return {
    "marchePublicRequestInput": $data.marchePublicRequest,
    "newStatus": "resend",
    "piecesJointesInput": $data.context.piecesJointes_ref

I also have an empty JSON object newDocuments

Contrainte document MimeType "application/pdf"


J'aimerais limiter le type de fichier a charger sur mon processus en PDF uniquement.
J'ai ajouter une contrainte et j'ai définie sa valeur a :

Nom : OnlyPdfDocument
expression : return pjDemandeCompteDocumentInput.getContentType() == "application/pdf" ? true : false
Message d'erreur : Veuillez charger un document de type PDF

Sur mon formulaire j'arrive a charger tout type de document.
Someone can help me