Render Document then Attach File in automation chain (Studio)

I've generated a file using Studio Automation Chain operator Conversion » Render Document. This works fine; if I add “User Interface -> Download File afterwards, the desired file is downloaded. I'd like to attach this file to the document from which it was rendered, using xpath files:files. Unfortunately, when I click the user action button, I get this error: “Failed to inject parameter 'document'. Seems it is missing from the context. Operation: Blob.Attach”

Here is my automation chain:

  • Context.FetchDocument
  • Context.SetVar: name: currentMyDoc value: “@{Document['uid:uid']}”
  • Render.Document: template: “template:dt-myXml” filename: myXml.xml mimetype: text/xml type: ftl
  • Blob.Attach: document: “@{currentMyDoc}” save: “true” xpath: “files:files”

The error I get is: Caught error: Failed to invoke operation BlobHolder.Attach Caused by: java.lang.NullPointerException Hierarchy calls

    org.nuxeo.ecm.automation.core.operations.FetchContextDocument
            org.nuxeo.ecm.automation.core.operations.SetVar
                     org.nuxeo.ecm.automation.core.rendering.operations.RenderDocument
                             org.nuxeo.ecm.automation.core.operations.services.BlobHolderAttach

…. Caused by: org.nuxeo.ecm.automation.OperationException: Failed to invoke operation BlobHolder.Attach

Any suggestions? I'm using Nuxeo 6.0 and have applied HF1-22.

0 votes

1 answers

4245 views

ANSWER



Figured out the answer. Instead of this line: Context.SetVar: name: currentMyDoc value: “@{Document['uid:uid']}” I needed this line: Context.SetVar: name: currentMyDoc value: “@{Document.id}”

0 votes