Thanks a lot, that was it!!!!<br><br>Seb<br><br><div class="gmail_quote">On Tue, Mar 15, 2011 at 10:08 PM, Ross H <span dir="ltr"><<a href="mailto:ross.hall@suncorp.com.au">ross.hall@suncorp.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Try using a changeset with file:path-to-your-changeset.xml rather than<br>
classpath:changeset.xml<br>
<div><div></div><div class="h5"><br>
<br>
SebRR wrote:<br>
><br>
> Yes I am using 5.1.1 and if I go to the latest xsd<br>
> (drools-spring-1.2.0.xsd), there is no attribute called 'knowledgeAgent' .<br>
><br>
> On Tue, Mar 15, 2011 at 2:09 PM, Esteban Aliverti <<br>
> <a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>> wrote:<br>
><br>
>> I think 5.1.1 should be fine. Which version are you using?<br>
>><br>
>> Best,<br>
>><br>
>><br>
>> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
>><br>
>> Esteban Aliverti<br>
>> - Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a><br>
>> - Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
>><br>
>><br>
>> On Tue, Mar 15, 2011 at 9:24 AM, Sébastien Raickman <<br>
>> <a href="mailto:sebastien.raickman@gmail.com">sebastien.raickman@gmail.com</a>> wrote:<br>
>><br>
>>> Hi Esteban,<br>
>>><br>
>>> yes my change set is linked to this resource:<br>
>>><br>
>>> *resource source="<br>
>>> <a href="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.mypackage/MySnapshot" target="_blank">http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.mypackage/MySnapshot</a><br>
>>> *<br>
>>><br>
>>> I have tried out the 2nd solution but JBoss says --> kAttribute<br>
>>> 'knowledgeAgent' is not allowed to appear in element 'drools:ksession'<br>
>>><br>
>>> Which version of Drools should I use for this?<br>
>>><br>
>>> Thanks<br>
>>><br>
>>><br>
>>> On Tue, Mar 15, 2011 at 12:59 PM, Esteban Aliverti <<br>
>>> <a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>> wrote:<br>
>>><br>
>>>> I suspect that the ksession defined in spring is created BEFORE the<br>
>>>> agent<br>
>>>> processes the resource. And even after the agent processes the<br>
>>>> resource, it<br>
>>>> will create a new kbase (because you are not using<br>
>>>> newInstance="false"), so<br>
>>>> the defined ksession will remain attached to an empty kbase.<br>
>>>> I can think in 2 solutions:<br>
>>>> 1.- Remove the ksession definition from the spring context file and<br>
>>>> create a new ksession using the kagent:<br>
>>>> kagent.newStatelessKnowledgeSession();<br>
>>>> 2.- Configure ksession's kagent from spring (this only works for<br>
</div></div>>>>> stateless ksessions): >> knowledgeAgent="kagent1"><br>
<div class="im">>>>><br>
>>>> By the way, the subject of this email says you re linking drools-server<br>
>>>> to Guvnor, but your changeset is not using any Guvnor's URL. Are you<br>
>>>> manually downloading the changeset.xml and putting it in your<br>
>>>> classpath?<br>
>>>><br>
>>>> Best Regards,<br>
>>>><br>
>>>> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
>>>><br>
>>>> Esteban Aliverti<br>
>>>> - Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a><br>
>>>> - Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
>>>><br>
>>>><br>
</div>>>>> 2011/3/15 Sébastien Raickman &<a href="mailto:lt%3Bsebastien.raickman@gmail.com">lt;sebastien.raickman@gmail.com</a>&gt;<br>
<div class="im">>>>><br>
>>>>> Hi all,<br>
>>>>><br>
>>>>> I would like to connect to drools-server with HTTPClient with the<br>
>>>>> following<br>
>>>>> config:<br>
>>>>><br>
</div><div class="im">>>>>> >>> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> xmlns:drools="<a href="http://drools.org/schema/drools-spring" target="_blank">http://drools.org/schema/drools-spring</a>"<br>
>>>>> xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" target="_blank">http://www.springframework.org/schema/beans</a><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> <a href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" target="_blank">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a><br>
>>>>> <a href="http://drools.org/schema/drools-spring" target="_blank">http://drools.org/schema/drools-spring</a><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
</div>>>>>> <a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd</a>">&nbsp;<br>
<div class="im">>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
</div><div><div></div><div class="h5">>>>>> where my changeset.xml is adding a snapshot deployed with Guvnor.<br>
>>>>><br>
>>>>> But I am not able to trig the rule with the following client:<br>
>>>>><br>
>>>>> BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();<br>
>>>>> command.setLookup("ksession1");<br>
>>>>> InsertObjectCommand insertObjectCommand = new<br>
>>>>> InsertObjectCommand("TEST");<br>
>>>>> FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();<br>
>>>>> command.getCommands().add(insertObjectCommand);<br>
>>>>> command.getCommands().add(fireAllRulesCommand);<br>
>>>>><br>
>>>>> String xml =<br>
>>>>> BatchExecutionHelper.newXStreamMarshaller().toXML(command);<br>
>>>>><br>
>>>>><br>
>>>>> HttpClient httpClient = new HttpClient();<br>
>>>>> httpClient.getHostConfiguration().setHost("host", 8080);<br>
>>>>><br>
>>>>> PostMethod postMethod = new<br>
>>>>> PostMethod("/drools-5.1.1-server/kservice/rest/execute");<br>
>>>>> postMethod.setRequestEntity(new StringRequestEntity(xml, null, null));<br>
>>>>><br>
>>>>><br>
>>>>> try {<br>
>>>>><br>
>>>>> httpClient.executeMethod(postMethod);<br>
>>>>> int code = postMethod.getStatusCode();<br>
>>>>> System.out.println(code);<br>
>>>>> String rep = postMethod.getResponseBodyAsString();<br>
>>>>> System.out.println(rep);<br>
>>>>><br>
>>>>> } catch(Exception e) {...}<br>
>>>>><br>
>>>>> Do someone have any idea how to achieve this?<br>
>>>>><br>
>>>>> Thanks<br>
>>>>><br>
>>>>> Sebastien<br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> rules-users mailing list<br>
>>>>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
>>>>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>><br>
><br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
<br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-server-link-to-Guvnor-repository-tp2682663p2683847.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-server-link-to-Guvnor-repository-tp2682663p2683847.html</a><br>
</font><div class="im">Sent from the Drools - User mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>