<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Render Document then Attach File in automation chain (Studio) in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/render-document-then-attach-file-in-automation-chain-studio/m-p/315742#M2743</link>
    <description>&lt;P&gt;I've generated a file using Studio Automation Chain operator Conversion &amp;gt;&amp;gt; Render Document. This works fine; if I add "User Interface -&amp;gt; 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"&lt;/P&gt;
&lt;P&gt;Here is my automation chain:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Context.FetchDocument&lt;/LI&gt;
&lt;LI&gt;Context.SetVar:
name: currentMyDoc
value: "@{Document['uid:uid']}"&lt;/LI&gt;
&lt;LI&gt;Render.Document:
template: "template:dt-myXml"
filename: myXml.xml
mimetype: text/xml
type: ftl&lt;/LI&gt;
&lt;LI&gt;Blob.Attach:
document: "@{currentMyDoc}"
save: "true"
xpath: "files:files"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;Any suggestions? I'm using Nuxeo 6.0 and have applied HF1-22.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2015 22:07:06 GMT</pubDate>
    <dc:creator>LaraGranite_</dc:creator>
    <dc:date>2015-11-11T22:07:06Z</dc:date>
    <item>
      <title>Render Document then Attach File in automation chain (Studio)</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/render-document-then-attach-file-in-automation-chain-studio/m-p/315742#M2743</link>
      <description>&lt;P&gt;I've generated a file using Studio Automation Chain operator Conversion &amp;gt;&amp;gt; Render Document. This works fine; if I add "User Interface -&amp;gt; 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"&lt;/P&gt;
&lt;P&gt;Here is my automation chain:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Context.FetchDocument&lt;/LI&gt;
&lt;LI&gt;Context.SetVar:
name: currentMyDoc
value: "@{Document['uid:uid']}"&lt;/LI&gt;
&lt;LI&gt;Render.Document:
template: "template:dt-myXml"
filename: myXml.xml
mimetype: text/xml
type: ftl&lt;/LI&gt;
&lt;LI&gt;Blob.Attach:
document: "@{currentMyDoc}"
save: "true"
xpath: "files:files"&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;Any suggestions? I'm using Nuxeo 6.0 and have applied HF1-22.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 22:07:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/render-document-then-attach-file-in-automation-chain-studio/m-p/315742#M2743</guid>
      <dc:creator>LaraGranite_</dc:creator>
      <dc:date>2015-11-11T22:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Render Document then Attach File in automation chain (Studio)</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/render-document-then-attach-file-in-automation-chain-studio/m-p/315743#M2744</link>
      <description>&lt;P&gt;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}”&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 02:42:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/render-document-then-attach-file-in-automation-chain-studio/m-p/315743#M2744</guid>
      <dc:creator>LaraGranite_</dc:creator>
      <dc:date>2015-11-12T02:42:04Z</dc:date>
    </item>
  </channel>
</rss>

