email connector attachment error

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. 

 

 

 

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.

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

I used Bonita Community Edition 7.8.3 to create this example.

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