01-11-2014 03:27 PM
Map<QName, Serializable> vars = new HashMap<QName, Serializable>();
NodeRef wfPackage = workflowService.createPackage(null);
QName contentQName = QName.createQName("{http://www.alfresco.org/model/content/1.0}content");
NodeRef node = fileFolderService.create(wfPackage, myfile.getName(), contentQName).getNodeRef();
ContentWriter writer = contentService.getWriter(node, ContentModel.PROP_CONTENT, true);
writer.putContent(new ByteArrayInputStream(IOUtils.readBytesFromStream(contentList.get(0).getInputStream())));
vars.put(WorkflowModel.ASSOC_PACKAGE, wfPackage);
WorkflowDefinition wfDefinition = workflowService.getDefinitionByName(workflowName);
workflowService.startWorkflow(wfDefinition.getId(), vars);
01-14-2014 01:38 AM
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.