cancel
Showing results for 
Search instead for 
Did you mean: 

Starting a process with MultipartFile object and accessing it from DelegateExecution object

prash_aggarwal
Champ in-the-making
Champ in-the-making
Hi,

I am uploading a file and getting it as MultipartFile object in my controller, i need to pass it when starting the process and access the file object in one of my java tasks using MultipartFile file = (MultipartFile)execution.getVariable("file");

Can i do that, it gives me
org.activiti.engine.ActivitiException: Couldn't serialize value 'org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile@1b1dcf7' in variable 'file'

The file is not getting serialized itself when starting the process and hence the failure.

Please let me know how can i do this?

Regards
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Don't serialize a Multipart file as a variable anyway, it's really bad for performance.
Store the file somewhere else (on disk for example) and store the reference to it in the process variable.

Thanks that helped.

Thanks that helped.