[rules-users] Rules fired without calling session.fireAllRules()

2008-11-17 Thread Jin Chai
Hi,

I have the following code, which is not working as I expected.

rule "New AlertFacade"
salience 1140
when
$af : AlertFacade();
then
System.out.println($af.getProperties());
end


In the java code:
   while (!isFireAllRules)
   {
 session.insert(alertFacade);
 
   }
   session.fireAllRules();


But I am seeing the rule "New AlertFacade" is fired everytime I inserted the
fact.  Shouldn't it wait until fireAllRules() be called? Am I missing something
here?

Thanks,
Jin

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 5.0 GA

2008-11-17 Thread Mark Proctor

Evans, Jess wrote:

Is there an ETA for the Drools 5.0 GA release?
not yet. Trying to get M3 out now, just correcting the build - we have a 
hard deadline for that for 19th, but hoping for tomorrow. of M3 is 
tomorrow, we'll see M4 or possibly a CR two to three weeks after that 
and a GA three to four weeks after that. Depending on user feedback.


Mark



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
  


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] 5.0 GA

2008-11-17 Thread Evans, Jess
Is there an ETA for the Drools 5.0 GA release?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Re: (interesting) migration problem from Drools 3.0.6 to Drools 4.0.7

2008-11-17 Thread Maxim Veksler
On Mon, Nov 17, 2008 at 7:17 PM, Maxim Veksler <[EMAIL PROTECTED]>wrote:

> Hello Everyone,
>
> Here's a fun stuff to debug:
>
>
> In our application we are using the concept of "Dynamic Beans", Drools is
> running in a webapp. The servlet container is tomcat6.
>
> Dynamic beans are beans we compile from java code and then load with a
> custom class loader. This happens in the following method :
>
> The class that implements ServletContextListener has in his
> contextInitialized(...) method a code to do the following: (simplification)
>
> ClassLoader cl = Janino.JavaSourceClassLoader(...)
> originalCl = Thread.currentThread().getContextClassLoader();
> Thread.currentThread().setContextClassLoader(cl);
>
> The above code allowed drools3 to find the Dynamic Classes (which didn't
> even existed, not to be mention were available to ANY classloader).
>
>
> Now, inside the .drl files we use properties from these dynamic beans -
> This allows us to be dynamic on the properties we can filter by.
>
> All good, but now comes the new Drools4 code. The application is no longer
> able to find the mentioned classes.
> The only changes the I've done was change Drools version from 3 to 4.
>
> The errors I'm getting are of the form :
>
> Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0,
> no-loop=false]
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type
> can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
> package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type
> can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
> package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:) : Only a type
> can be imported. com.X.common.dataModel.facts.banner.X resolves to a package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import
> com.X.common.dataModel.facts.X.X cannot be resolved
> ...
>
> Anyone has ideas how to over come this?
>
> I'm currently searching for alternatives, I'm thinking about Configuring my
> custom class loader at the webapp level or something like that...
> Help would be appreciated as I'm not getting much success.
>

Hello,

This seems like it should have been the solver of my problem, but for some
reason this does not work:

PackageBuilderConfiguration pbc = new PackageBuilderConfiguration();
//pbc.setCompiler(PackageBuilderConfiguration.JANINO);
pbc.setClassLoader(DynamicBeanManager.getInstance().getCl());

Any one got (any) idea about what I'm doing wrong?


Also (a bit off topic), In the old version we used the commented line
(setting drl compiler to janino).
Does 4.0.7 version uses JANINO as default?


Thank you,
Maxim.

-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] (interesting) migration problem from Drools 3.0.6 toDrools 4.0.7

2008-11-17 Thread Maxim Veksler
Hello Joe,

On Mon, Nov 17, 2008 at 7:54 PM, Joe White <[EMAIL PROTECTED]>wrote:

>  Maxim,
>
> Are the classes you are trying to reference multiple levels of inner
> classes? Drools 4 cannot reference nested inner classes in drl. That issue
> is fixed in the release for drools 5.
>
>
>
> Joe
>
>
>
No, I'm afraid they are "Simple" compilation units.
They do extend their "basic" versions, but this AFAIK should not be a
problem.

Never the less, thank you for the information.

Maxim.

>  *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Maxim Veksler
> *Sent:* Monday, November 17, 2008 10:17 AM
> *To:* Rules Users List
> *Subject:* [rules-users] (interesting) migration problem from Drools 3.0.6
> toDrools 4.0.7
>
>
>
> Hello Everyone,
>
> Here's a fun stuff to debug:
>
>
> In our application we are using the concept of "Dynamic Beans", Drools is
> running in a webapp. The servlet container is tomcat6.
>
> Dynamic beans are beans we compile from java code and then load with a
> custom class loader. This happens in the following method :
>
> The class that implements ServletContextListener has in his
> contextInitialized(...) method a code to do the following: (simplification)
>
> ClassLoader cl = Janino.JavaSourceClassLoader(...)
> originalCl = Thread.currentThread().getContextClassLoader();
> Thread.currentThread().setContextClassLoader(cl);
>
> The above code allowed drools3 to find the Dynamic Classes (which didn't
> even existed, not to be mention were available to ANY classloader).
>
>
> Now, inside the .drl files we use properties from these dynamic beans -
> This allows us to be dynamic on the properties we can filter by.
>
> All good, but now comes the new Drools4 code. The application is no longer
> able to find the mentioned classes.
> The only changes the I've done was change Drools version from 3 to 4.
>
> The errors I'm getting are of the form :
>
> Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0,
> no-loop=false]
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type
> can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
> package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type
> can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
> package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:) : Only a type
> can be imported. com.X.common.dataModel.facts.banner.X resolves to a package
> com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import
> com.X.common.dataModel.facts.X.X cannot be resolved
> ...
>
> Anyone has ideas how to over come this?
>
> I'm currently searching for alternatives, I'm thinking about Configuring my
> custom class loader at the webapp level or something like that...
> Help would be appreciated as I'm not getting much success.
>
> --
> Cheers,
> Maxim Veksler
>
> "Free as in Freedom" - Do u GNU ?
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] (interesting) migration problem from Drools 3.0.6 toDrools 4.0.7

2008-11-17 Thread Joe White
Maxim,

Are the classes you are trying to reference multiple levels of inner classes? 
Drools 4 cannot reference nested inner classes in drl. That issue is fixed in 
the release for drools 5.

 

Joe

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Maxim Veksler
Sent: Monday, November 17, 2008 10:17 AM
To: Rules Users List
Subject: [rules-users] (interesting) migration problem from Drools 3.0.6 
toDrools 4.0.7

 

Hello Everyone,

Here's a fun stuff to debug:


In our application we are using the concept of "Dynamic Beans", Drools is 
running in a webapp. The servlet container is tomcat6.

Dynamic beans are beans we compile from java code and then load with a custom 
class loader. This happens in the following method :

The class that implements ServletContextListener has in his 
contextInitialized(...) method a code to do the following: (simplification)

ClassLoader cl = Janino.JavaSourceClassLoader(...)
originalCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);

The above code allowed drools3 to find the Dynamic Classes (which didn't even 
existed, not to be mention were available to ANY classloader).


Now, inside the .drl files we use properties from these dynamic beans - This 
allows us to be dynamic on the properties we can filter by.

All good, but now comes the new Drools4 code. The application is no longer able 
to find the mentioned classes. 
The only changes the I've done was change Drools version from 3 to 4. 

The errors I'm getting are of the form :

Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0, 
no-loop=false]
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type can 
be imported. com.X.common.dataModel.facts.dynamic.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type can 
be imported. com.X.common.dataModel.facts.dynamic.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:) : Only a type can 
be imported. com.X.common.dataModel.facts.banner.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import 
com.X.common.dataModel.facts.X.X cannot be resolved
...

Anyone has ideas how to over come this?

I'm currently searching for alternatives, I'm thinking about Configuring my 
custom class loader at the webapp level or something like that... 
Help would be appreciated as I'm not getting much success.

-- 
Cheers, 
Maxim Veksler

"Free as in Freedom" - Do u GNU ?

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] (interesting) migration problem from Drools 3.0.6 to Drools 4.0.7

2008-11-17 Thread Maxim Veksler
Hello Everyone,

Here's a fun stuff to debug:


In our application we are using the concept of "Dynamic Beans", Drools is
running in a webapp. The servlet container is tomcat6.

Dynamic beans are beans we compile from java code and then load with a
custom class loader. This happens in the following method :

The class that implements ServletContextListener has in his
contextInitialized(...) method a code to do the following: (simplification)

ClassLoader cl = Janino.JavaSourceClassLoader(...)
originalCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);

The above code allowed drools3 to find the Dynamic Classes (which didn't
even existed, not to be mention were available to ANY classloader).


Now, inside the .drl files we use properties from these dynamic beans - This
allows us to be dynamic on the properties we can filter by.

All good, but now comes the new Drools4 code. The application is no longer
able to find the mentioned classes.
The only changes the I've done was change Drools version from 3 to 4.

The errors I'm getting are of the form :

Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0,
no-loop=false]
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type
can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type
can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:) : Only a type
can be imported. com.X.common.dataModel.facts.banner.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import
com.X.common.dataModel.facts.X.X cannot be resolved
...

Anyone has ideas how to over come this?

I'm currently searching for alternatives, I'm thinking about Configuring my
custom class loader at the webapp level or something like that...
Help would be appreciated as I'm not getting much success.

-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Measuring execution time of each rule?

2008-11-17 Thread David Sinclair
Mark,

As a follow up to this question, does drools keep the number of times a
pattern has been evaluated? The reason I am asking is because I have used
ArtEnterprise for rules systems and it provides the number of times a
pattern was evaluated, along with the time it took.

thanks

dave

On Mon, Nov 17, 2008 at 10:43 AM, Mark Proctor <[EMAIL PROTECTED]>wrote:

>  Maxim Veksler wrote:
>
> Hello,
>
> I'm hard at work on improving performance of our Drools setup.
>
> I was wondering if there is some built in way to measure the execution time
> of each rule?
>
> There are before and after rule firing events, so you can record the time
> stamps for that.
>
>
>
> Thank you,
> Maxim.
>
> --
> Cheers,
> Maxim Veksler
>
> "Free as in Freedom" - Do u GNU ?
>
> --
>
> ___
> rules-users mailing [EMAIL 
> PROTECTED]://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Measuring execution time of each rule?

2008-11-17 Thread Mark Proctor

Maxim Veksler wrote:

Hello,

I'm hard at work on improving performance of our Drools setup.

I was wondering if there is some built in way to measure the execution 
time of each rule?
There are before and after rule firing events, so you can record the 
time stamps for that.



Thank you,
Maxim.

--
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
  


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Measuring execution time of each rule?

2008-11-17 Thread Maxim Veksler
Hello,

I'm hard at work on improving performance of our Drools setup.

I was wondering if there is some built in way to measure the execution time
of each rule?


Thank you,
Maxim.

-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] BRMS in a WAS cluster

2008-11-17 Thread Vikrant Yagnick
Hi Seema,

I am attaching the repository.xml we had used. Yes, it could be possible that 
JackRabbit would need to be configured for clustering.(I guess we missed that 
one).  (You will need to change repository.xml in that case as specified).

The main reason we cannot use the BRMS for our current project is that our 
deadlines do not allow us to wait till the GA of Release 5 (when we can get 
enterprise support for it) and we cannot use 4.0.7 as it does not have some 
features important to us(like Security etc).

Release 5 of the BRMS is really good and if you can use it, you should go for 
it.

Cheers,
Vikrant

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seema Manivannan
Sent: Saturday, November 15, 2008 7:36 AM
To: Rules Users List
Subject: Re: [rules-users] BRMS in a WAS cluster

Vikrant,

Thanks for the prompt reply. It would be surely helpful if you can post the 
samples which worked for you. What are the license and support issues that made 
you decide against BRMS? My understanding is that we need to enable JackRabbit 
clustering when we have JackRabbit running in all nodes of the app server 
cluster. Oracle RAD would handle only clustering at the DB level. Please 
correct me if I'm wrong.

Thanks,
Seema
On Thu, Nov 13, 2008 at 1:18 PM, Vikrant Yagnick <[EMAIL 
PROTECTED]> wrote:

Hi Seema,



We had initially tried using the BRMS for rules using WAS 6.1 and Oracle in 
clustered modes.

While, we are not going for the BRMS right now due to license and support 
issues, from that experience I can answer some of the questions, below.



From: [EMAIL PROTECTED] [mailto:[EMAIL 
PROTECTED]] On Behalf Of Seema Manivannan
Sent: Thursday, November 13, 2008 6:15 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] BRMS in a WAS cluster



hi,

I would appreciate any replies at least confirming that my approach below is 
right.

Thanks,
Seema

On Sun, Nov 9, 2008 at 11:16 PM, seemamani <[EMAIL PROTECTED]> wrote:

We use Drools 4.0.7 in our application which is deployed on a WAS 6.1 cluster
and it is working fine. Now we want to deploy the Drools BRMS also in the
WAS cluster. I went through the Drools and Jackrabbit mailing lists and
documentation. Please confirm if my understanding of how this can be
implemented is correct.

1. By default, JackRabbit uses Apache Derby in-memory database which does
not support clustering



That is correct



2. We need to configure a persistence manager in JackRabbit that stores data
in a RDBMS like Oracle





Yes. If you need a sample, I can send it to you. (Though, I am sure there is a 
lot of material on this on the web).

3. I need to follow the instructions for JackRabbit clustering given here
http://wiki.apache.org/jackrabbit/Clustering



I am not sure, why you need Jack Rabbit clustering. If the tables are stored in 
the database, then I am assuming RAC should handle clustering at the DB level.  
Though, do correct me if I am wrong.



4.  Also, the Drools documentation says that "The BRMS will create the
tables the first time it is started up if it is running against a fresh
(empty) RDBMS - so its important to note that the user credentials supplied
have permissions to create tables (at least initially, on first run, after
that they could be locked down)."
Is it not possible to create the Oracle tables before running the BRMS (we
have permission issues in creating the tables from the application)? I
assume that the DDL for creating the tables is available with the JackRabbit
distribution.



One Q&D way may be to just create the tables in a test database and then make 
the schema into DDL scripts for use before installation.



5. Is there anything else I'm missing? Will BRMS work fine in the cluster
with the above setup?



My assumption is that the BRMS is just a web-app using the database as it's 
back-end and hence do not know of any issues it could face.

Thanks,
Seema
--
View this message in context: 
http://www.nabble.com/BRMS-in-a-WAS-cluster-tp20408825p20408825.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users







MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended