0 Replies Latest reply on Feb 22, 2008 10:41 AM by (William_Taylro)

    TaskManager setDocument issue

      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();

      taskManager.claimTask(1234);

      FormInstance fi = taskManager.getEmptyForm(); //also tried taskManager.getFormInstanceForTask(1234, formInstanceid, true);

      FileInputStream localPDF = new FileInputStream("c:\\localpdf.pdf");

      Document newPDF = new Document(localPDF);

      fi.setDocument(newPDF);

      writePDF(fi.getDocument()); //THIS WORKS!!

      taskManager.save(taskId, fi);

      taskManager.complete(taskId); //File in written in next task is not correct

      thanks,

      bt