Uploaded File not showing in File Viewer widget

1
0
-1

Hello,

Please I am battling to get uploaded files displayed in File Viewer widget. Steps taken:

1. At pool level, I created a document named mainDoc (Data - Documents)

2. In my Form, I added Upload widget. URL is ../API/formFileUpload

3. I added File Viewer widget on a verifying form within the same process with properties: File Source: Process Document and Process Document: context.mainDoc_ref

Context variable is created as External API - /bonita/API/bpm/userTask/{{taskId}}/context

Result: Form is submitted with the upload attachment without issue but no attachment is available in the File Viewer widget.

Any help will be well appreciated.

Best regards,

Henry.

Comments

Submitted by julien.mege on Tue, 03/31/2020 - 13:38

Hello,

just to be sure i understand your use case:

You Upload a doc in Task1 and you try to browse it in Task2 ? (this is mandatory, because you cannot preview a "Process document" if this one is not already attached to the process)

Did you generate a contract for task1? (Question behind, did you have an operation that put the submitted document into the "Process document"?)

Julien.

Submitted by henryogbu_1420825 on Tue, 03/31/2020 - 14:54

Thank you Julien.

1. Yes, I uploaded in task one but not able to see it in task 2.

2. I generated contract for Task1 however, the upload is not part of the contract as I want it as optional in the Form.

Clearly, I do not know how to configure Operation that put the submitted document into the "Process document" and then reference in Task2.

Please help with steps of what I should do. I am barely new to Bonita and trying to learn as quickly as possible.

Best regards,

Henry.

2 answers

1
0
-1

If you really need to do everything inside the same page you can have a look at this documentation page:

https://documentation.bonitasoft.com/bonita/7.10/bpm-api#toc15

To eventually post the document in a separated call (in a Modal container for example?)

1
0
-1

unfortunately, you cannot have a none valuated value in your contract.

So the simplest way would be to create a dedicated task "Add a Document",

then in your task1, you put a checkbox to ask : "Would you add attached file after this?"

If checkbox=true, go to "Add a Document task",

else go to task2.

Without this, you would need to manage everything in a dedicated restAPI, and it could became a bit complex.

Notifications