Hi,
I am uploading xml file for workflow and following is the submit method.
@RequestMapping(value="/client/admin/workflow", method=RequestMethod.POST)
public String adminWorkflowPost(FileUpload fileUpload, HttpSession s) {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
CommonsMultipartFile fileData = fileUpload.getFileData();
try {
// Set the name to subprogramId, so the deployment can be retrieved.
repositoryService.createDeployment()
.addInputStream(fileData.getOriginalFilename(), fileData.getInputStream()).name(String.valueOf(fileUpload.getSubprogramId()))
.deploy();
} catch (IOException e) {
e.printStackTrace();
}
return "redirect:/client/admin/workflow.html?id=" + fileUpload.getSubprogramId();
}