title: Oracle Workflow API: adding and accessing file Attachments to a Human Task
body: <p>I am using the Workflow Services Java API (11.1.1) for SOA Suite to access and manipulate human tasks. I would like to be able to access and add file attachments to existing human tasks. I am using the methods provided in the AttachmentType interface.</p>
  
  <p>When adding an attachment, the problem I am running into is that an attachment does get created and associated with the task, however it is empty and has no content. I have attempted both setting the input stream of the attachment, as well as the content string and in each case have had no success (and setting the content string results in an exception when trying to update the corresponding task).</p>
  
  <p>I have successfully added and accessed an attachment using the worklist application, however when trying to access the content of this attachment through code I receive an object with mostly null/0 values throughout, apart from the attachment name. </p>
  
  <p>The code I am using to access attachments resembles:</p>
  
  <pre><code>List attachments = taskWithAttachments.getAttachment();
  for(Object o : attachments){
  
      AttachmentType a = (AttachmentType) o;
      String content = a.getContent(); // NULL
      InputStream str = a.getInputStream(); // NULL
      String name = a.getName(); // Has the attachment name
      String mime = a.getMimeType(); // Has the mime type
      long size = a.getSize(); // 0
      ...
  }
  </code></pre>
  
  <p>As the API's are not overly rich in documentation I may well be using them incorrectly. I would really appreciate any help/suggestions/alternatives in dealing with BPEL task attachments.</p>
  
  <p>Thanks</p>