Hello Camunda community! I’m trying to upload an Excel file to a process instance using a Java client. When I directly pass the multipart file, I encounter a Jackson serialization error. On the other hand, if I pass only the byte of the file, the MIME type changes to ‘text/plain’ instead of remaining as ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’. Could you please provide guidance on how to properly handle this situation and maintain the correct MIME type?
Thanks in advance
Shreyas Unhale
Hi @shreyasUnhale - the process engine doesn’t support data types like XLS. You can read more about the support types for variables at the documentation link below.
What is it you are trying to do with the spreadsheet? What is the process trying to use it for?
Hi @nathan.loading
So basically I have a recommendation flow where a user adds value into an excel file which has columns like name phone number e-mail Id and pan number . Once user uploads the file a camunda workflow gets triggered and one of the task is to upload the file to Amazon s3bucket .
If you have any idea on how can I pass the file to the service task which validates if the entered file is excel or not.
@shreyasUnhale - you wouldn’t put the spreadsheet in the process. It would be accessible by your application and the process controls what happens next. The way I would set this up is to upload the spreadsheet to my application, which receives it and kicks off a new process. I would probably log the spreadsheet into a database and give it a unique ID, and send that ID to the process. Then the process can trigger a job worker that validates the spreadsheet and uploads it, or whatever else needs to be done with it.
Solved this issue @nathan.loding created a serializable object for file in Java and passes file properties with it that way I can use file content and mime type to convert byte array back to file
@shreyasUnhale - that is certainly one way to work around it, but I would caution against sending too much data to the process. The more data there is, the slower the process will run, and the more resources it will consume (which can add to increased costs). When I think about data, I try to think about them in terms of “process data” and “application data.”
Process data would be the small pieces of data that the process needs to move to the next step. It probably needs to know IDs/primary keys of data, and needs to know some values for decision gateways. It doesn’t need to have a social security number or credit card number.
On the other hand, my application does need to know the social security number or credit card number. Storing that data in the application and having the job workers/connectors fetch that data when needed is the recommended route.
Based on the little bit you shared about your process, I would consider the full spreadsheet to be application data, not process data, and I would recommend sending only the small bits of related data needed to advance the process rather than all the data needed for every task.