<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Spyros,<br>
<br>
I understand your ideia. and i think It's a good approach.<br>
Have to try it :) thx<br>
<br>
Regards<br>
&nbsp;&nbsp;&nbsp; Carlos V.<br>
<br>
Spyros Sakellariou wrote:
<blockquote cite="midauto-000015994691@iris.intranet.gr" type="cite">
  <pre wrap="">My thinking is that when the Web Service returns (asynchronously through JMS
or by an extra thread that you created) to insert the result into the memory
perhaps as a generic reply object so other rules will fire when the object
is inserted, depending of course on the contents of the reply object.  

You will have to use a stateful session for this to work and I think that
you will have to keep calling the fireAllRules() after each returning Web
Service reply is inserted into the working memory.    

About JMS it is a much better alternative of creating asynchronous requests
than creating your own threads, as you will find support for Thread Pooling,
Transactions, Priority queues etc. depending on the JMS implementation.  Of
course you can achieve the same with creating your own threads but I think
it will be a lot of work.
 

Spyros



Spyros Sakellariou 
Principal Product Manager - Solution Architect


Markopoulo Ave. 
19002 Paiania Athens, Greece 
Tel. +30 210 667 9874 
Mob. +30 694 700 7984 
email <a class="moz-txt-link-abbreviated" href="mailto:ssake@intracom.gr">ssake@intracom.gr</a>  


-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of Carlos Vieira
Sent: Wednesday, October 31, 2007 5:46 PM
To: Rules Users List
Subject: Re: [rules-users] Executing rules actions asynchronously

Hi Spyros,

Well, i tried launching a thread for each Web Service call, and it works
ok... but i need to use the return of Web Service in the right side of
the rule to, for example, insert another fact... so, i have to wait for
the execution...
What i want is to execute a set of actions (in the right side of a rule)
in a different thread.

But i will look for JMS to see capabilities, and to see if fit my purposes.

Thx for the help

Regards
    Carlos V.

Spyros Sakellariou wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Carlos,

I don't know if this is possible in drools but an alternative is instead
    </pre>
  </blockquote>
  <pre wrap=""><!---->of
  </pre>
  <blockquote type="cite">
    <pre wrap="">calling web services synchronously from drools, to call them
    </pre>
  </blockquote>
  <pre wrap=""><!---->asynchronously
  </pre>
  <blockquote type="cite">
    <pre wrap="">using JMS.  That way you don't have to wait for each service to return. 

Spyros


-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of Carlos Vieira
Sent: Wednesday, October 31, 2007 5:02 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Subject: [rules-users] Executing rules actions asynchronously

Hi,

I'm facing a situation, that maybe some of you just solved out in the
    </pre>
  </blockquote>
  <pre wrap=""><!---->past.
  </pre>
  <blockquote type="cite">
    <pre wrap="">I need that the execution of matched rules ( Activations that are
already in the Agenda, referencing those rules) is done asynchronously.

In more detail, i need that each set of actions owned by two or more
rules, runs in a separated thread.
The problem here is that i need to invoke external Web Services in rule
actions.... well, some Web Services may take too long to return
something, what makes the other actions of other rules to wait for
this... what is not an expected behavior...

Any one knows if jboss rules already support this kind of approach? If
not, any one has passed through this?
Accessing to the mechanism of firing individual rules seems to be the
best way, overriding a couple of classes..... how can i fire just one
rule with jboss rules? is this the best choice?

Well, if anyone has any idea, it would be nice

Regards
    Carlos V.

_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  
    </pre>
  </blockquote>
  <pre wrap=""><!---->

_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>