I am trying to add a file to my workflow. Here is the (relevant) code:
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);
I am getting no errors. When I log onto alfresco explorer, I see the task in my todo list. I click on it, and all the other pices of data are there (things I set in the model) and displaying properly. However, the Resources section is blank. No files are showing up.What am I doing wrong?