document

Modify a document in an application page

Hello,

I'm trying to have an application page which allows some user to modify some documents in a case.

First I'm retrieving the documents to modify using this API in a table :

../API/bpm/caseDocument?p=0&c=10&f=name=nomDoc&f=caseId={{caseId}}

Then I'm using an upload widget with the default URL in order to upload the new version: ../API/formFileUpload

And finally I have a button to execute the update with a PUT request to ../API/bpm/caseDocument/{{selectionDoc.id}} and a json payload filled with "file" and "description"

Document not accessible in "Overview" but available in Mail connector

Hello,

in my app I attach correctly a document with a groovy connector:

....

processAPI.attachDocument(processInstanceId, "documentXYZ", doc.name, "application/pdf", doc.bytes);

....

Then I send it with an e-mail connector as an attachment, but If I try to open it in case Overview I get the error "500 Internal Server Error. Oops. Error.". In the logfile I've: "org.bonitasoft.forms.server.DocumentImageServlet Error while retrieving the document with ID xxxxxx from the engine."

It seems that the document ID in the url is not correct.

Leer Csv documento

Buenas Tengo una duda, me gustaria saber como puedo leer un csv que me traigo desde un widget tipo upload file y este lo almaceno en una variable tipo documento. necesito leer este archivo para poder almacenarlo en un tabla en mi BD pero no se como puedo tratarlo.

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.
Ali

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

Hi
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
Mauro

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

Hi
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?

Hi,

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!!.

Notifications