I'm trying to set a Document object in a task that is already been created however the Document object doesn't seem to update correctly. I can set the Document object, get it back out via the API (correctly) however when the task is sent the next step (task) the file that is written out is the original document object.
I'm doing something like this :
TaskManager taskManager = getTaskManager();
FormInstance fi = taskManager.getEmptyForm(); //also tried taskManager.getFormInstanceForTask(1234, formInstanceid, true);
FileInputStream localPDF = new FileInputStream("c:\\localpdf.pdf");
Document newPDF = new Document(localPDF);
writePDF(fi.getDocument()); //THIS WORKS!!
taskManager.complete(taskId); //File in written in next task is not correct