07-08-2015 06:39 PM
FileInputStream fs;
try {
fs = new FileInputStream("test-doc.pdf");
//attach it to the process at large
//TODO: get the attachment mimetype
workflowData.put("workflowdocument", IOUtils.toByteArray(fs));
logger.info("Attaching file as workflowdocument to process");
} catch (Exception e) {
logger.error("Failed to attach mock file to process", e);
}
…
ProcessInstance newInstance = runtimeService.startProcessInstanceById(processId, workflowData);
logger.info("Started workflow " + newInstance.getId() + " with process: " + processId);
FileInputStream fs;
try {
fs = new FileInputStream("test-doc.pdf");
//attach it to the process at large
//TODO: get the attachment mimetype
Attachment attachment = taskService.createAttachment("application/pdf", null, newInstance.getId(), "workflowdocument", "test doc", fs);
} catch (FileNotFoundException e) {
logger.error("Failed to attach file to process: " + newInstance.getId(), e);
}
07-09-2015 02:48 AM
07-09-2015 08:06 AM
07-09-2015 10:08 AM
07-09-2015 02:21 PM
07-09-2015 03:20 PM
07-14-2015 03:14 PM
07-14-2015 03:15 PM
07-14-2015 04:02 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.