Mark has provided the elegant way to do it. However, as a newbie, it can be done simpler without using this API for stateless rules,.<br>In this JIRA, <a href="https://jira.jboss.org/jira/browse/GUVNOR-354">https://jira.jboss.org/jira/browse/GUVNOR-354</a>, you will find complete working examples.<br>
<br>This has a ruby file, which invokes the webservice --> easily doable in struts<br>It uses json format - you could pass in the xml format as well.<br><br>You don't have to use Guvnor, its just that Guvnor has tooling that creates the packaging (.pkg files) , snapshots, etc and it is easier. <br>
You can skip Guvnor ( I just have'nt tried it).<br><br><br clear="all">Regards,<br>Prem<br>
<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 9:05 AM, tanzu <span dir="ltr"><<a href="mailto:tanu421@rediffmail.com">tanu421@rediffmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
My requirement is to expose drools rules as a web service ,which can be<br>
accessed by any kind of client including .net .I have built a struts based<br>
web application.When the user submits the struts client should be able to<br>
submit the data ,to the web service ,which will execute the rule engine ,and<br>
fire all rules ,and send a response back to the client.You said it correctly<br>
the drools execution server can suffice my need.<br>
<br>
<br>
My doubts are<br>
1.Is it possible that I dont use guvnor ,and instead use just the drools<br>
expert with drl files with the execution server.<br>
2.The data from the struts client should be converted into xml ,fact object<br>
and sent to the server to be used in the rules.Am I thinking right.<br>
<br>
A sample code showing how the client ,sends xml data to server ,and the<br>
response sent back to the client ,will be very helpful to me.<br>
<br>
Please help.I have a deadline.:-(<br>
<br>
tanzu<br>
<div><div></div><div class="h5"><br>
<br>
<br>
pkpkpkpk wrote:<br>
><br>
> Using the Drools execution server, the rules engine can be exposed as a<br>
> web<br>
> service.<br>
><br>
> In<br>
> <a href="http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-guvnor/html_single/index.html" target="_blank">http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-guvnor/html_single/index.html</a>,<br>
> check out section 1.4.7.2<br>
><br>
> The web service can be invoked using JSON or XML, so, it is possible to<br>
> invoke it from any client.<br>
><br>
> Regards,<br>
> Prem<br>
><br>
><br>
> On Sun, Jun 14, 2009 at 6:45 AM, tanzu <<a href="mailto:tanu421@rediffmail.com">tanu421@rediffmail.com</a>> wrote:<br>
><br>
>><br>
>> Can the drools rule engine ,be exposed as a web service or do we need to<br>
>> write a web service and make an explicit call to rule engine ,using the<br>
>> working memory.<br>
>> Is it possible for a .net application to invoke drools rule engine.<br>
>><br>
>><br>
>> Please help as I am a newbie<br>
>><br>
>><br>
>> Thanks<br>
>> tanzu<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p23961020.html" target="_blank">http://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p23961020.html</a><br>
>> Sent from the drools - user mailing list archive at Nabble.com.<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>
> 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://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p24092604.html" target="_blank">http://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p24092604.html</a><br>
</font><div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br>