Attach File

1
0
-1

I assign the attachment to a process variable, I have read that a document is created in the pool, but when I do the assignment in the option data widget shows me the following error: "expression document type is not supported"

2 answers

1
0
-1
This one is the BEST answer!

The documentation on the file widget is not very clear. I've figured this out after hours playing with it.

The problem you are having is because you have the wrong assignment type. For a file widget, you must use "Set document" to assign its value to a Document.

(Click on the file widget, go to General/Data. I assume right now, since you're having problems, the blue assignment link connecting the file widget and your Document data says, "Takes value of". Click on it, and change it to "Set document")

Hope this helps. -Bao

P.s: This is not related but since Anthony is watching this post, I have a quick question for Anthony. Knowing that you're very knowledgeable Bonita developer, is there away to remove an attachment from a process (after attaching it to the process using ProcessAPI.attachDocument())in Bonita 6.x?

Thank you

Comments

Submitted by anthony.birembaut on Tue, 04/29/2014 - 15:13

Hi,

Indeed, the type of the action to perform is different for a document from what it is for a variable.

Currently there is no method to remove an attachment from a process once it has been added. The only thing you can do is adding a new version document with a null value.

Submitted by vivantech on Tue, 04/29/2014 - 20:15

Thanks for responding Anthony.

Our application deals with a lot of attachments. We have our own attachment management scheme. so the attachments saved in Bonita database is not really needed. We just want to clear them out to free the memory.

I'm thinking of directly manipulate the content of the document (blob) in the 'document_content' table in Bonita database (replacing it with 1 byte of data).

What do you think?

Thanks, -Bao

Submitted by vivantech on Tue, 04/29/2014 - 20:15

Thanks for responding Anthony.

Our application deals with a lot of attachments. We have our own attachment management scheme. so the attachments saved in Bonita database is not really needed. We just want to clear them out to free the memory.

I'm thinking of directly manipulate the content of the document (blob) in the 'document_content' table in Bonita database (replacing it with 1 byte of data).

What do you think?

Thanks, -Bao

Submitted by anthony.birembaut on Wed, 04/30/2014 - 10:30

I would advise against that. We discourage anyone from any direct modification of the database. If you really need to do that, I think a better way would be to write a process connector that uses our DocumentService to remove the document content.

Submitted by vivantech on Wed, 04/30/2014 - 18:39

I've searched the Bonita Javadoc but couldn't find DocumentService API. Would you point me to where the document is.

Thanks, -Bao

1
0
-1

Hi,

You cannot assign an attachment to a process variable. You need to use a document data instead of a variable data (it's in a different section below the variable section when you are designing your process). You will then be able to select this document as output of the file widget in your form.

Comments

Submitted by ale.ghirardi on Mon, 04/28/2014 - 17:14

That was precisely what I did, create a document but when I assign the output widget shows me an error

Submitted by anthony.birembaut on Mon, 04/28/2014 - 17:35

Did you use a file widget ? Only file widgets can be used to set the value of a document.

Submitted by Nigel on Tue, 04/29/2014 - 17:19

Hi, Thanks for your comments about document management in Bonita and the lack of clear documentation about it. We are planning a review and update of this in the near future. Stay tuned...

Notifications