<div>Dear All,</div><div><br></div><div>I&#39;m using Drools integrated to Camel trough Rest, but I&#39;m unable to receive objects inserted in the session by the rules, I&#39;m inserting the fact acordos.Acordo and in the &quot;then&quot; section of the rule I create new facts to be returned to my app in this case is the fact acordos.Retorno, but I&#39;m unable to access this facts in the Rest response</div>

<div><br></div><div>Does anybody have some clue how to get these objects inserted?</div><div><br></div><div>Follow bellow what I&#39;m sending, receiving and my rule:</div><div><br></div><div>Rule Definition:</div><div><div>

<font face="&#39;courier new&#39;, monospace" size="1">package acordos</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><br></font></div><div><font face="&#39;courier new&#39;, monospace" size="1">declare Acordo</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>dataReserva: java.util.Date</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>dataEmbarque: java.util.Date</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>gds: String</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>ciaAerea: String</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>tipoAcordo: String</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>conexao: String</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>origem: String</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>destino: String</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>empresa: String</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>unidade: String</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>cliente: String</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">end</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><br></font></div><div><font face="&#39;courier new&#39;, monospace" size="1">declare Retorno</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>codAcordo: String</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">end</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><br></font></div><div><font face="&#39;courier new&#39;, monospace" size="1">#generated from Decision Table</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">import teste.*;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">import java.util.Date;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"># rule values at C18, header at C13</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1">rule &quot;tabelaTeste(Acordo acordo)_18&quot;</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>salience 65518</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>when</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">                </span>Acordo(getDataReserva().after(new Date(&quot;22-Oct-2009&quot;)), getDataReserva().before(new Date(&quot;31-Dec-2015&quot;)), getDataEmbarque().after(new Date(&quot;1-Jan-2012&quot;)), getDataEmbarque().before(new Date(&quot;31-Dec-2012&quot;)), gds == &quot;1&quot;, ciaAerea == &quot;AA&quot;, tipoAcordo == &quot;1&quot;, getOrigem() in (&quot;Brasil&quot;), getDestino() in(&quot;América do Norte&quot;,&quot;Brasil&quot;,&quot;Estados Unidos&quot;,&quot;Canadá&quot;,&quot;Ásia&quot;,&quot;América Central&quot;,&quot;América do Sul&quot;,&quot;Mexico&quot;,&quot;Europa&quot;,&quot;Caribe&quot;))</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">        </span>then</font></div><div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println(&quot;teteteetetet&quot;);</font></div>

<div><font face="&#39;courier new&#39;, monospace" size="1"><span class="Apple-tab-span" style="white-space:pre">                </span>Retorno _retorno = new Retorno();</font></div><div><span class="Apple-tab-span" style="font-family:&#39;courier new&#39;,monospace;font-size:x-small;white-space:pre">                </span><font face="&#39;courier new&#39;, monospace" size="1">_retorno.setCodAcordo(&quot;PEB06&quot;);</font></div>

<div><span class="Apple-tab-span" style="font-family:&#39;courier new&#39;,monospace;font-size:x-small;white-space:pre">                </span><font face="&#39;courier new&#39;, monospace" size="1">insert(_retorno);</font></div><div><font face="&#39;courier new&#39;, monospace" size="1">end</font></div>

</div><div><br></div><div><br></div><div>Rest request:</div><div><div><font size="1" face="&#39;courier new&#39;, monospace">curl  -v -H &quot;Content-Type: text/plain&quot; --data &quot;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">  &lt;batch-execution lookup=\&quot;ksession1\&quot;&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">    &lt;insert out-identifier=\&quot;message\&quot;&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">      &lt;acordos.Acordo&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;dataReserva&gt;2012-01-30 08:00:00.000 -0300&lt;/dataReserva&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;dataEmbarque&gt;2012-01-30 08:00:00.000 -0300&lt;/dataEmbarque&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;gds&gt;1&lt;/gds&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;ciaAerea&gt;AA&lt;/ciaAerea&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;conexao&gt;&lt;/conexao&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;origem&gt;Brasil&lt;/origem&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;destino&gt;Brasil&lt;/destino&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;tipoAcordo&gt;1&lt;/tipoAcordo&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">      &lt;/acordos.Acordo&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">      &lt;acordos.Retorno&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">        &lt;codAcordo&gt;&lt;/codAcordo&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">      &lt;/acordos.Retorno&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">    &lt;/insert&gt;</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">    &lt;fire-all-rules out-identifier=\&quot;firedActivations\&quot; /&gt;</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">  &lt;/batch-execution&gt;&quot; <a href="http://localhost:8080/drools-camel-server-5.4.0.Final/kservice/rest/execute">http://localhost:8080/drools-camel-server-5.4.0.Final/kservice/rest/execute</a></font></div>

</div><div><br></div><div>Rest Response:</div><div><div><font size="1" face="&#39;courier new&#39;, monospace">&lt; HTTP/1.1 200 OK</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">&lt; Server: Apache-Coyote/1.1</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">&lt; Date: Tue, 15 May 2012 22:20:00 GMT</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">&lt; Content-Type: text/plain</font></div><div>
<font size="1" face="&#39;courier new&#39;, monospace">&lt; Content-Length: 528</font></div>
<div><font size="1" face="&#39;courier new&#39;, monospace">&lt; </font></div><div><font size="1" face="&#39;courier new&#39;, monospace">* Connection #0 to host localhost left intact</font></div><div><font size="1" face="&#39;courier new&#39;, monospace">* Closing connection #0</font></div>

<div><font size="1" face="&#39;courier new&#39;, monospace">&lt;?xml version=&#39;1.0&#39; encoding=&#39;UTF-8&#39;?&gt;&lt;execution-results&gt;&lt;result identifier=&quot;message&quot;&gt;&lt;acordos.Acordo&gt;&lt;dataReserva&gt;2012-01-30 11:00:00.0 UTC&lt;/dataReserva&gt;&lt;dataEmbarque&gt;2012-01-30 11:00:00.0 UTC&lt;/dataEmbarque&gt;&lt;gds&gt;1&lt;/gds&gt;&lt;ciaAerea&gt;AA&lt;/ciaAerea&gt;&lt;tipoAcordo&gt;1&lt;/tipoAcordo&gt;&lt;conexao&gt;&lt;/conexao&gt;&lt;origem&gt;Brasil&lt;/origem&gt;&lt;destino&gt;Brasil&lt;/destino&gt;&lt;/acordos.Acordo&gt;&lt;/result&gt;&lt;result identifier=&quot;firedActivations&quot;&gt;&lt;int&gt;1&lt;/int&gt;&lt;/result&gt;&lt;fact-handle identifier=&quot;message&quot; external-form=&quot;0:2:1717445911:1717445911:2:DEFAULT&quot;/&gt;&lt;/execution-results&gt;</font></div>

</div><div><br></div><div>Best Regards,</div><br clear="all">Antonio Anderson Souza<br><pre><a href="http://174.129.217.139:8080/makecallclient/callme?p=YXNvdXphQHZvaWNlLmJyYXN0ZWwuY29tLmJy" target="_blank"></a></pre><a style="font-family:verdana,sans-serif" href="http://www.antonioams.com" target="_blank">Blog</a> - <a href="http://twitter.com/antonioams" target="_blank">Twitter</a> - <a href="http://br.linkedin.com/in/antonioams" target="_blank">LinkedIn</a> - <a href="http://www.facebook.com/antonioams" target="_blank">Facebook</a><br>

<br>