email connector attachment error

1
0
-1

Hello,

I created an email connector with attach files and it works well.

When I attach the file, it works well. However, once I didn't attach the file, it has an error.

I validate formOutput like :

if($data.formInput.authdocumentDocumentInput){
return {
'authdocumentDocumentInput': $data.formInput.authdocumentDocumentInput
};

}else{
return {
'authdocumentDocumentInput': null
};
}

But, the error occurred when I didn't attach the file.

Caused by: org.bonitasoft.engine.connector.ConnectorException: org.bonitasoft.engine.connector.ConnectorException: unable to retrieve attachments for the email.

Caused by: org.bonitasoft.engine.connector.ConnectorException: unable to retrieve attachments for the email

Caused by: org.bonitasoft.engine.bpm.document.DocumentNotFoundException: USERNAME=ConnectorAPIAccessorImpl | org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException: Document not found: authdocument for process instance: 60037

Did i something miss or do I need to add groovy script in the connector instead of variable?

Any help would be appreciated.

Thanks in advanced.

1 answer

1
+1
-1
This one is the BEST answer!

I did some test and managed to reproduce your issue.

By looking at email connector source code I think that if email connector is configure to have attachment, the document(s) used as attachment must be initialized.

One workaround I found is to add some logic in the process to initialize the document with an empty value if no file was uploaded. I create an example that demonstrate that.

Another workaround would be to create your own custom email connector.

Comments

Submitted by donghee.baik on Mon, 04/08/2019 - 15:13

Thanks for the answer. However, I could not import the BOS file.
Would you let me know what is the version of the file?

Submitted by antoine.mottier on Mon, 04/08/2019 - 15:31

I used Bonita Community Edition 7.8.3 to create this example.

Submitted by donghee.baik on Mon, 04/08/2019 - 15:45

Thanks for the reply. I am using Bonita studio 7.6.3. I will update the studio and will work it again.
Thanks a lot

Notifications