title: How to load and pass a Xforms form in Orbeon (How to Send instance to XForms)?
body: <p>I am using the Orbeon Forms solution to generate messages from filled-in web forms.</p>
  
  <p>I read different code snippetse in Orbeon's wiki on XForms submission from a pipeline, and I tried different solutions but it doesn't work, and there is no example with a POST from a pipeline, caught by a PFC and sent to an XForms view that receives the posted data (all examples are done in the same page). </p>
  
  <p>I have the following pipeline which is received on his instance input: </p>
  
  <p><strong>pipelineWrite.xpl</strong></p>
  
  <pre><code>&lt;p:config ...&gt;
      &lt;p:param name="instance" type="input"/&gt; &lt;!-- instance containing the data of the form filled by user --&gt;
      &lt;p:param name="data" type="output"/&gt;
  
      &lt;p:processor name="oxf:java"&gt; &lt;!-- transforms the data into a file --&gt;
          &lt;p:input name="config"&gt;
              &lt;config sourcepath="." class="ProcessorWriteCUSDECCD001B"/&gt;
          &lt;/p:input&gt;
          &lt;p:input name="input" href="#instance"/&gt;
          &lt;p:output name="output" id="file"/&gt; &lt;!-- XML containing the url of the file --&gt;
      &lt;/p:processor&gt;       
  &lt;/p:config&gt; 
  </code></pre>
  
  <p>Then there is the PFC which catch the actions :</p>
  
  <p><strong>page-flow.xml</strong></p>
  
  <pre><code>&lt;config xmlns="http://www.orbeon.com/oxf/controller"&gt;
  
      &lt;page path-info="/CUSDECCD001B/" view="View/ViewForm.xhtml"/&gt; &lt;!-- load the form to be filled in by user --&gt;
  
      &lt;page path-info="/CUSDECCD001B/write" model="Controller/PipelineWrite.xpl"/&gt; &lt;!-- send the instance of the form filled to the pipeline above --&gt;
  
      &lt;page path-info="/CUSDECCD001B/success" view="View/ViewSuccess.xhtml"/&gt; &lt;!-- send the instance containing the url of the file to the success view --&gt;
  
      &lt;epilogue url="oxf:/config/epilogue.xpl"/&gt;
  &lt;/config&gt; 
  </code></pre>
  
  <p>Then there is the success view, which is very simple : </p>
  
  <p><strong>ViewSuccess.xhtml</strong></p>
  
  <pre><code>&lt;html ... &gt;
    &lt;head&gt;
      &lt;title&gt;Generation OK&lt;/title&gt;
      &lt;xforms:model&gt;
              &lt;xforms:instance id="FILE" src="input:instance"&gt;
                  &lt;files xmlns=""&gt;
                      &lt;file mediaType="" filename="" size="" /&gt;
                  &lt;/files&gt;
              &lt;/xforms:instance&gt;
          &lt;/xforms:model&gt;
    &lt;/head&gt;
    &lt;body&gt;
          Click here to download :
          &lt;xforms:output ref="//file" appearance="xxforms:download"&gt;
              &lt;xforms:filename ref="@filename"/&gt;
              &lt;xforms:mediatype ref="@mediatype"/&gt;
              &lt;xforms:label&gt;Download&lt;/xforms:label&gt;
          &lt;/xforms:output&gt;
    &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>All this process I launched by clicking on the "Save" button in the "ViewModify" page :</p>
  
  <p><strong>ViewModify.xhtml</strong></p>
  
  <pre><code>&lt;xforms:model&gt;
      &lt;xforms:instance id="CUSDECCD001B" src="../apps/CUSDECCD001B/Model/ModelCUSDECCD001B.xml" /&gt;
      &lt;xforms:submission id="save-submission" ref="instance('CUSDECCD001B')" action="/CUSDECCD001B/write" replace="instance" instance="CUSDECCD001BFile"&gt;
          &lt;xforms:send ev:event="xforms-submit-done" submission="send-to-success"/&gt;
      &lt;/xforms:submission&gt;
      &lt;xforms:submission id="send-to-success" method="post" action="/CUSDECCD001B/success" ref="instance('CUSDECCD001BFile')" replace="all"/&gt;
  &lt;/xforms:model&gt;
  
    &lt;!-- .... Content of XForms form --&gt;
  
  &lt;xforms:submit submission="save-submission"&gt;
      &lt;xforms:label&gt;Save&lt;/xforms:label&gt;
  &lt;/xforms:submit&gt;
  </code></pre>
  
  <p>The problem is that the post is done well, the PFC catches the action well, load the correct view, but the view is loaded with no data (the view doesn't find the data on his instance input).</p>
  
  <p>I tried with a GET in the view to retrieve the POST data, and that's the same thing. No data is retrieved. So the download button doesn't work.</p>
  
  <p>I hope I'm clear enough to find a solution. 
  Thanks in advance.</p>