email connector attachment error
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 :
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.