[rules-users] Auditing Requirement

2008-03-07 Thread manrai.java
Hi,

We have a requirement were in we want to create an audit report after rules
have been executed. For each rule, we need to track Desired Condition
Value(as
specified in when part), Actual Condition Value(value in asserted object)
and so on. This data is to be collected not only for rules which finally got
fired but also for rules which failed.

It would be great if someone can guide me how to achieve this.

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


Re: [rules-users] Setting date during execution of rules.

2008-03-07 Thread Mark Proctor
Effective dates in 4.0.x come from Calendar.getInstance() so unless you 
change the time that the java Calendar sees you cannot go back in time. 
Trunk, and 5.0 (TBR in Q2/Q3),  has a class called TimeMachine which 
allows you to set the date.


If you need control of this, and in 4.0.x, you will not be able to use 
the effective date attributes. Instead I recommend you create your own 
hashmap ofr effective dates per rule and use the agenda filter to 
excludes ones that aren't within the allowed dates.


Mark
Nimesh Muley wrote:


I was not able to portray the right picture L. Here's another shot at 
clarifying my situation.


 


Let's say we have a commission rule as follows

rule Commission Calculation *07-08*

  *date-effective 01-Apr-2007*

  *date-expires 30-Mar-2008*

  when

   

  then

   

end

 


Now for the next financial year we define a new rule as follows

rule Commission Calculation *08-09*

  *date-effective 01-Apr-2008*

  *date-expires 30-Mar-2009*

  when

   

  then

   

end

 

Now let's say /_today's date is 15^th April 2008_/. An agent is 
promoted today with /_effective date as 1^st March 2008_/. Hence his 
commission needs to be recalculated as per the Commission Calculation 
*07-08* rule and *_not_* the effective rule as on today i.e. 
Commission Calculation *08-09*. For rest of the agents commission 
would be calculated based on the rule effective today i.e. 15^th April 
2008. Hence a need to pass a date during execution of rule based on 
which the right rule would be chosen.


 

Basically there is no legacy code as part of my example but a need to 
fire the rules that are effective on a date other than the system date 
always.


 

I have seen similar functionality in other rules engines too. Can this 
be done in JBoss Rules? If yes, is TimeMachine the right way of doing it?


 


Regards,

- Nimesh

 




*From:* [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] *On Behalf Of *Scott Reed

*Sent:* Wednesday, March 05, 2008 8:40 PM
*To:* Rules Users List
*Subject:* Re: [rules-users] Setting date during execution of rules.

 

As I understand it, the problem is that you have legacy code that uses 
the system date in it's calculations and you cannot fix that so it 
will take a date parameter, right? If so, then my recommendation is to 
fix the legacy software if possible since messing with the system date 
gives me the willies. If you can't fix it, then anything that can be 
called from Java to set the system date 
(e.g.Runtime.exec(...).waitfor()?) should be callable from the 'then' 
part of a rule. Make that call, call your legacy code, then make the 
call to set the date back. But that is so ugly, please don't tell 
anyone I had anything to do with it.


Nimesh Muley's message received 3/5/2008 1:25 AM:

Hi,

 

Is there a way to set the date while executing the rules? The 
effective dates would be checked against this date instead of today's 
date. By default the effective dates would be checked with System 
date. But in some cases we would need to execute the rules in a 
'back-dated' mode.


 


Use case.

Let's say in insurance industry there are commission calculation rules 
for an agent. On these rules the effective dates are appropriate (as 
per their needs). Now when an agent is promoted and his/her promotion 
date is couple of months back then we would want to calculate the 
commission once again with the date as 2 months back.


 

The nearest I could see is TimeMachine, as this is being used during 
execution of rules. Although I could not find a way to set the 
TimeMachine in release 4.0.4.


 


Has anyone tried something like this before?

 


Regards,

- Nimesh

The first 90% of a project takes 90% of the time, the last 10% takes 
the other 90% of the time - Murphy's Law


While so very true, this is not Murphy's Law, which I think of as 
Whatever can go wrong, probably will. (see 
http://en.wikipedia.org/wiki/Murphy%27s_law)
Your rule here is called the 90-90 rule: 
http://en.wikipedia.org/wiki/Ninety-ninety_rule


 

 





MASTEK LTD.
Making a valuable difference
Mastek 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 person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in 

Re: [rules-users] Problem passing objects to a method via the eval statement

2008-03-07 Thread Mark Proctor

The 'or' must be used for classes of the same type.

Mark
Joshua Undesser wrote:

I am curious if anyone else has run into this problem.It seems like there
is something wrong in the Drools LogicMy issue can be very easily be
recreated in about 5 minutes

From eclipse I set up a new drools project.Where DroolTest.java is
defined I create 4 new classes,   ClassA, ClassB extends ClassA, ClassC
extends ClassA, and ClassD.

Each of these classes has a default constructor that does nothing, there are
no attributes or anything in these classes just to make the example simple
to reproduce.   Ie ClassA looks like this



package com.sample;

public class ClassA {

public ClassA() {
}
}



Now within the DroolsTest.java source code at line 29 (ie right after the
workingMemory.insert( message ) method call I added 4 more lines which
creates and inserts two objects...

ClassB classB = new ClassB();
ClassD classD = new ClassD();
workingMemory.insert( classB );
workingMemory.insert( classD );

and then the next line would be the 
workingMemory.fireAllRules();   
as normal.



Then in the sample.drl file I add the following rule and functions

1 rule Test
2when
3
4   $classA : ClassA()
5   $classD : ClassD()
6   
7   (or
8   $classB : ClassB(eval($classB == $classA))
9   $classC : ClassC(eval($classC == $classA))
10  )   
11  
12  eval(retB($classA, $classD))
13
14  then
15  System.out.println(\n\nFIRE RULETEST);  
16 end  
17
18 function boolean retA(Object obj) {
19   System.out.println(Ret Val =  + obj);
20   return true;
21 }
22
23 function boolean retB(Object obj1, Object obj2) {
24   System.out.println(Ret Val 1 =  + obj1);
25   System.out.println(Ret Val 2 =  + obj2);
26   return true;
27 }



So what I am doing is very quick and very simple to reproduce.   What is
happening is that when i run the program I am getting a class cast exception
which is very very strange.


At first I thought it was tied only to the OR statement because if I break
the rule into two rules (one for each of the or conditions) it works fine.

But after playing with it a little further I get a lot of other strange
class cast exceptions.

For instance if I replace line 12 (eval(retB($classA, $classD))) with
eval(retA($classA))  it works fine, but if I replace it with
eval(retA($classD)) I get another class cast exception.Another strainge
issueif switch lines 4 and 5 and keep line 12 as eval(retA($classD))
that previously failed, it now passes, but if I change line 12 back to
eval(retA($classA)) which previously passed it now fails.

There are a few other combinations that produce errors as well.  Just seems
to be a fundamental flaw in the logic and I'm curious if anyone else has
seen this?

Thanks!

Joshua

P.S.

Also I've noticed an issue with the manual example 6.36 



This does not seem to work for me
	pensioner : (or Person( sex == f, age  60 ) 
Person( sex == m, age  65 ) )



But this does
(or pensioner : Person( sex == f, age  60 ) 
pensioner : Person( sex == m, age  65 ) )





Although both formats are stated as working in the manual.






  


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


Re: [rules-users] Problem passing objects to a method via the eval statement

2008-03-07 Thread Mark Proctor

Mark Proctor wrote:

The 'or' must be used for classes of the same type.
Also there was some 'or' issues fixed for 4.0.5. You can test this from 
the 4.0.x branch, let us know if it fixes all your problems.

http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/


Mark
Joshua Undesser wrote:
I am curious if anyone else has run into this problem.It seems 
like there

is something wrong in the Drools LogicMy issue can be very easily be
recreated in about 5 minutes

From eclipse I set up a new drools project.Where DroolTest.java is
defined I create 4 new classes,   ClassA, ClassB extends ClassA, ClassC
extends ClassA, and ClassD.

Each of these classes has a default constructor that does nothing, 
there are
no attributes or anything in these classes just to make the example 
simple

to reproduce.   Ie ClassA looks like this



package com.sample;

public class ClassA {

public ClassA() {

}
}



Now within the DroolsTest.java source code at line 29 (ie right after 
the

workingMemory.insert( message ) method call I added 4 more lines which
creates and inserts two objects...

ClassB classB = new ClassB();
ClassD classD = new ClassD();
workingMemory.insert( classB );
workingMemory.insert( classD );

and then the next line would be the 
workingMemory.fireAllRules();   as normal.



Then in the sample.drl file I add the following rule and functions

1 rule Test
2 when
3
4$classA : ClassA()
5$classD : ClassD()
6   
7(or

8$classB : ClassB(eval($classB == $classA))
9$classC : ClassC(eval($classC == $classA))
10)   
11   
12eval(retB($classA, $classD))   
13

14then
15System.out.println(\n\nFIRE RULETEST);   
16 end   
17

18 function boolean retA(Object obj) {
19   System.out.println(Ret Val =  + obj);
20   return true;
21 }
22
23 function boolean retB(Object obj1, Object obj2) {
24 System.out.println(Ret Val 1 =  + obj1);
25 System.out.println(Ret Val 2 =  + obj2);
26 return true;
27 }



So what I am doing is very quick and very simple to reproduce.   What is
happening is that when i run the program I am getting a class cast 
exception

which is very very strange.


At first I thought it was tied only to the OR statement because if I 
break
the rule into two rules (one for each of the or conditions) it works 
fine.


But after playing with it a little further I get a lot of other strange
class cast exceptions.

For instance if I replace line 12 (eval(retB($classA, $classD))) with
eval(retA($classA))  it works fine, but if I replace it with
eval(retA($classD)) I get another class cast exception.Another 
strainge

issueif switch lines 4 and 5 and keep line 12 as eval(retA($classD))
that previously failed, it now passes, but if I change line 12 back to
eval(retA($classA)) which previously passed it now fails.

There are a few other combinations that produce errors as well.  Just 
seems

to be a fundamental flaw in the logic and I'm curious if anyone else has
seen this?

Thanks!

Joshua

P.S.

Also I've noticed an issue with the manual example 6.36

This does not seem to work for me
pensioner : (or Person( sex == f, age  60 ) 
Person( sex == m, age  65 ) )



But this does
(or pensioner : Person( sex == f, age  60 ) pensioner : 
Person( sex == m, age  65 ) )





Although both formats are stated as working in the manual.






  





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


Re: [rules-users] Auditing Requirement

2008-03-07 Thread Mark Proctor

manrai.java wrote:

Hi,
 
We have a requirement were in we want to create an audit report after 
rules have been executed. For each rule, we need to track Desired 
Condition Value(as
specified in when part), Actual Condition Value(value in asserted 
object) and so on. This data is to be collected not only for rules 
which finally got fired but also for rules which failed.
 
It would be great if someone can guide me how to achieve this.
Have you seen the WorkingMemoryFileLogger and the Eclipse audit viewer? 
If that doesn't do what you need out of the box, maybe you can modify it 
to your requirements. If you do any interesting additions to it, please 
pass them on.


Mark
 
Regards

Manrai


___
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] Problem using Package Builder

2008-03-07 Thread Mehak

Hi
I am using Package Builder for making rule base in my web application. The
code is:
public class DroolSetUp implements  ResourceLoaderAware{
private static RuleBase ruleBase;
private Resource  drlFiles; 
public void setResourceLoader(ResourceLoader arg0) {
try {

ruleBase = RuleBaseFactory.newRuleBase();
File file = drlFiles.getFile();
FileInputStream   fileStream = new FileInputStream(file);  
 Reader source = new InputStreamReader(fileStream );
PackageBuilder builder = new PackageBuilder(); 
  builder.addPackageFromXml(source); 
System.out.println(builder.toString());
Package pkg = builder.getPackage();
 
ruleBase.addPackage(pkg ); 
 
}
catch(Exception e)
{

}

}
}
But there is a problem that the method returns after the statement
 PackageBuilder builder = new PackageBuilder(); 
Please le me know what the problem can be.
Waiting for an early response
Thanks
-- 
View this message in context: 
http://www.nabble.com/Problem-using-Package-Builder-tp15891216p15891216.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


Re: [rules-users] Problem using Package Builder

2008-03-07 Thread john

 But there is a problem that the method returns after the statement
  PackageBuilder builder = new PackageBuilder();
 Please le me know what the problem can be.
 Waiting for an early response
 Thanks

It's likely throwing an exception because it cannot find the rule files. 
Print a stacktrace in your catch block, I suspect it will tell you what
the problem is.

John

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


[rules-users] RuleAgent question

2008-03-07 Thread Eric Miles
Is the rule agent only good for drl files or serialized packages?  What
about dsl or ruleflow inclusion?  I'm looking through the source and it
seems it doesn't deal with either of items I've identified.

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


[rules-users] Maven compilation mojo?

2008-03-07 Thread Eric Miles
Is there a Maven Drools compilation mojo, provided either by the Drools
team or some open source project?  If not, I have one that I'd be
willing to submit.  I think it's pretty slick and would only require a
few tweaks to truly make it useful (hard coded to currently use XStream
serialization).
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] FW: Can I use drools to solve my problem?

2008-03-07 Thread Anstis, Michael (M.)
Posted to forum for a wider audience.

I think you will need to be more specific with your use case.

With kind regards,

Mike

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 07 March 2008 15:35
To: Anstis, Michael (M.)
Subject: Can I use drools to solve my problem?

I have a list of products and want to divide this list in other lists
applying the rules, than i want to apply the same rules to this new lists.
So I keep dividing them until no rules are applicable anymore.

Thank you


smime.p7s
Description: S/MIME cryptographic signature
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Problem passing objects to a method via the eval statement

2008-03-07 Thread Joshua Undesser

Thank you Mark for the quick reply.   I am curious if this is only temporary
or if this is the protocol that Drools is going to use for or statements?  
The reason I ask is that i come from a jess/clips background, where or can
be used across multiple classes as shown in my example and it is very useful
when you have two huge rules that are identical except for one LHS class
pattern difference. 

Obviously the fix for now is to break up the rule into two rules, but I was
curious if this was only a temporary restriction or if this is going to be
the standing protocol?

I'll also grab the new 4.0.5 branch as you mentioned and give that a whirl.

Thanks again Mark!

Joshua
   




Mark Proctor wrote:
 
 The 'or' must be used for classes of the same type.
 
 Mark
 Joshua Undesser wrote:
 I am curious if anyone else has run into this problem.It seems like
 there
 is something wrong in the Drools LogicMy issue can be very easily be
 recreated in about 5 minutes

 From eclipse I set up a new drools project.Where DroolTest.java is
 defined I create 4 new classes,   ClassA, ClassB extends ClassA, ClassC
 extends ClassA, and ClassD.

 Each of these classes has a default constructor that does nothing, there
 are
 no attributes or anything in these classes just to make the example
 simple
 to reproduce.   Ie ClassA looks like this



 package com.sample;

 public class ClassA {
  
  public ClassA() {
  }
 }



 Now within the DroolsTest.java source code at line 29 (ie right after the
 workingMemory.insert( message ) method call I added 4 more lines which
 creates and inserts two objects...

 ClassB classB = new ClassB();
 ClassD classD = new ClassD();
 workingMemory.insert( classB );
 workingMemory.insert( classD );

 and then the next line would be the 
 workingMemory.fireAllRules();   
 as normal.


 Then in the sample.drl file I add the following rule and functions

 1 rule Test
 2 when
 3
 4$classA : ClassA()
 5$classD : ClassD()
 6
 7(or
 8$classB : ClassB(eval($classB == $classA))
 9$classC : ClassC(eval($classC == $classA))
 10   )   
 11   
 12   eval(retB($classA, $classD))
 13
 14   then
 15   System.out.println(\n\nFIRE RULETEST);
 16 end   
 17
 18 function boolean retA(Object obj) {
 19   System.out.println(Ret Val =  + obj);
 20   return true;
 21 }
 22
 23 function boolean retB(Object obj1, Object obj2) {
 24System.out.println(Ret Val 1 =  + obj1);
 25System.out.println(Ret Val 2 =  + obj2);
 26return true;
 27 }



 So what I am doing is very quick and very simple to reproduce.   What is
 happening is that when i run the program I am getting a class cast
 exception
 which is very very strange.


 At first I thought it was tied only to the OR statement because if I
 break
 the rule into two rules (one for each of the or conditions) it works
 fine.

 But after playing with it a little further I get a lot of other strange
 class cast exceptions.

 For instance if I replace line 12 (eval(retB($classA, $classD))) with
 eval(retA($classA))  it works fine, but if I replace it with
 eval(retA($classD)) I get another class cast exception.Another
 strainge
 issueif switch lines 4 and 5 and keep line 12 as eval(retA($classD))
 that previously failed, it now passes, but if I change line 12 back to
 eval(retA($classA)) which previously passed it now fails.

 There are a few other combinations that produce errors as well.  Just
 seems
 to be a fundamental flaw in the logic and I'm curious if anyone else has
 seen this?

 Thanks!

 Joshua

 P.S.

 Also I've noticed an issue with the manual example 6.36 


 This does not seem to work for me
  pensioner : (or Person( sex == f, age  60 ) 
 Person( sex == m, age  65 ) )


 But this does
 (or pensioner : Person( sex == f, age  60 ) 
 pensioner : Person( sex == m, age  65 ) )




 Although both formats are stated as working in the manual.






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

-- 
View this message in context: 
http://www.nabble.com/Problem-passing-objects-to-a-method-via-the-eval-statement-tp15885523p15898856.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


Re: [rules-users] Re: Maven compilation mojo?

2008-03-07 Thread Eric Miles
I have not performed any tests on this, but I'm sure the Drools guys
could comment on it as they provide serialized vs non-serialized support
in the framework.  I would have to think it would decrease
initialization time as you're only de-serializing objects vs compiling a
rule set.  Of course, your build time will increase :)

Our main goal was to limit the number (and size) of the jars we had to
include in our application as we already had a very large distributable
for our application.

Some features of the compilation mojo:
- Precompiles drls, ruleflow, and dsl into their individual packages
- Supports single package being spread across multiple DRL and rule flow
files using same package name.
- Supports DSL through a specific naming convention (some work could be
done here to be a little more flexible)
- Supports compression to decrease serialized package file sizes
(Currently gzip, could tweak to support other compressions)
- Serializes via XStream (could be tweaked to support different
serialization mechanisms)

Eric

On Fri, 2008-03-07 at 16:57 +0100, Geoffrey De Smet wrote:
 Sounds interesting.
 Does it noticeably decrease RuleBase initialization time at runtime?
 
 With kind regards,
 Geoffrey De Smet
 
 
 Eric Miles wrote:
  Is there a Maven Drools compilation mojo, provided either by the Drools
  team or some open source project?  If not, I have one that I'd be
  willing to submit.  I think it's pretty slick and would only require a
  few tweaks to truly make it useful (hard coded to currently use XStream
  serialization).
  ___
  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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Problem passing objects to a method via the eval statement

2008-03-07 Thread Edson Tirelli
   Joshua,

   The limitation is on binding variables on different fact types on
different logical branches and using them in the consequence. If you don't
use the bindings in the consequence, you are fine.

   This is a temporary limitation.

   []s
   Edson

2008/3/7, Joshua Undesser [EMAIL PROTECTED]:


 Thank you Mark for the quick reply.   I am curious if this is only
 temporary
 or if this is the protocol that Drools is going to use for or
 statements?
 The reason I ask is that i come from a jess/clips background, where or
 can
 be used across multiple classes as shown in my example and it is very
 useful
 when you have two huge rules that are identical except for one LHS class
 pattern difference.

 Obviously the fix for now is to break up the rule into two rules, but I
 was
 curious if this was only a temporary restriction or if this is going to be
 the standing protocol?

 I'll also grab the new 4.0.5 branch as you mentioned and give that a
 whirl.

 Thanks again Mark!

 Joshua






 Mark Proctor wrote:
 
  The 'or' must be used for classes of the same type.
 
  Mark
  Joshua Undesser wrote:
  I am curious if anyone else has run into this problem.It seems like
  there
  is something wrong in the Drools LogicMy issue can be very easily
 be
  recreated in about 5 minutes
 
  From eclipse I set up a new drools project.Where DroolTest.java is
  defined I create 4 new classes,   ClassA, ClassB extends ClassA, ClassC
  extends ClassA, and ClassD.
 
  Each of these classes has a default constructor that does nothing,
 there
  are
  no attributes or anything in these classes just to make the example
  simple
  to reproduce.   Ie ClassA looks like this
 
 
 
  package com.sample;
 
  public class ClassA {
 
   public ClassA() {
   }
  }
 
 
 
  Now within the DroolsTest.java source code at line 29 (ie right after
 the
  workingMemory.insert( message ) method call I added 4 more lines which
  creates and inserts two objects...
 
  ClassB classB = new ClassB();
  ClassD classD = new ClassD();
  workingMemory.insert( classB );
  workingMemory.insert( classD );
 
  and then the next line would be the
  workingMemory.fireAllRules();
  as normal.
 
 
  Then in the sample.drl file I add the following rule and functions
 
  1 rule Test
  2 when
  3
  4$classA : ClassA()
  5$classD : ClassD()
  6
  7(or
  8$classB : ClassB(eval($classB == $classA))
  9$classC : ClassC(eval($classC == $classA))
  10   )
  11
  12   eval(retB($classA, $classD))
  13
  14   then
  15   System.out.println(\n\nFIRE RULETEST);
  16 end
  17
  18 function boolean retA(Object obj) {
  19   System.out.println(Ret Val =  + obj);
  20   return true;
  21 }
  22
  23 function boolean retB(Object obj1, Object obj2) {
  24System.out.println(Ret Val 1 =  + obj1);
  25System.out.println(Ret Val 2 =  + obj2);
  26return true;
  27 }
 
 
 
  So what I am doing is very quick and very simple to reproduce.   What
 is
  happening is that when i run the program I am getting a class cast
  exception
  which is very very strange.
 
 
  At first I thought it was tied only to the OR statement because if I
  break
  the rule into two rules (one for each of the or conditions) it works
  fine.
 
  But after playing with it a little further I get a lot of other strange
  class cast exceptions.
 
  For instance if I replace line 12 (eval(retB($classA, $classD))) with
  eval(retA($classA))  it works fine, but if I replace it with
  eval(retA($classD)) I get another class cast exception.Another
  strainge
  issueif switch lines 4 and 5 and keep line 12 as
 eval(retA($classD))
  that previously failed, it now passes, but if I change line 12 back to
  eval(retA($classA)) which previously passed it now fails.
 
  There are a few other combinations that produce errors as well.  Just
  seems
  to be a fundamental flaw in the logic and I'm curious if anyone else
 has
  seen this?
 
  Thanks!
 
  Joshua
 
  P.S.
 
  Also I've noticed an issue with the manual example 6.36
 
 
  This does not seem to work for me
   pensioner : (or Person( sex == f, age  60 )
  Person( sex == m, age  65 ) )
 
 
  But this does
  (or pensioner : Person( sex == f, age  60 )
  pensioner : Person( sex == m, age  65 ) )
 
 
 
 
  Although both formats are stated as working in the manual.
 
 
 
 
 
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 


 --
 View this message in context:
 http://www.nabble.com/Problem-passing-objects-to-a-method-via-the-eval-statement-tp15885523p15898856.html

 Sent from the drools - user mailing list archive at Nabble.com.

 ___

 rules-users mailing list
 rules-users@lists.jboss.org
 

Re: [rules-users] Re: Maven compilation mojo?

2008-03-07 Thread Fernando Meyer
Hi Eric,

Someone already made a contrib of a maven plugin, I think I did some review
on that code but it never went to mainstream.
could you please compare your code to the attachment?
http://jira.jboss.org/jira/browse/JBRULES-1273



On Fri, Mar 7, 2008 at 1:22 PM, Eric Miles [EMAIL PROTECTED] wrote:

 I have not performed any tests on this, but I'm sure the Drools guys
 could comment on it as they provide serialized vs non-serialized support
 in the framework.  I would have to think it would decrease
 initialization time as you're only de-serializing objects vs compiling a
 rule set.  Of course, your build time will increase :)

 Our main goal was to limit the number (and size) of the jars we had to
 include in our application as we already had a very large distributable
 for our application.

 Some features of the compilation mojo:
 - Precompiles drls, ruleflow, and dsl into their individual packages
 - Supports single package being spread across multiple DRL and rule flow
 files using same package name.
 - Supports DSL through a specific naming convention (some work could be
 done here to be a little more flexible)
 - Supports compression to decrease serialized package file sizes
 (Currently gzip, could tweak to support other compressions)
 - Serializes via XStream (could be tweaked to support different
 serialization mechanisms)

 Eric

 On Fri, 2008-03-07 at 16:57 +0100, Geoffrey De Smet wrote:
  Sounds interesting.
  Does it noticeably decrease RuleBase initialization time at runtime?
 
  With kind regards,
  Geoffrey De Smet
 
 
  Eric Miles wrote:
   Is there a Maven Drools compilation mojo, provided either by the
 Drools
   team or some open source project?  If not, I have one that I'd be
   willing to submit.  I think it's pretty slick and would only require a
   few tweaks to truly make it useful (hard coded to currently use
 XStream
   serialization).
   ___
   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 mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Fernando Meyer http://fmeyer.org
JBoss Rules Core Developer
[EMAIL PROTECTED]
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: Maven compilation mojo?

2008-03-07 Thread Eric Miles
Interesting I had no idea something already existed (in some form).
While his supports more source type compilations than mine does
currently (csv, xls, etc), his requires a bit more configuration than
mine does.

His requires that you specify which files belong to which compiled unit
which can lead to a really noisy pom if you have a very large number of
packages and/or source files.  This also allows a little bit finer
grained control over what source files belong in which compiled unit
over my implementation.

Mine on the other hand, traverses the identified source directory and
programmatically groups together source files with identical package
names.  This requires less configuration in the pom, however you have
less control over how/what goes into a serialized package.  It assumes
if you have multiple rules identified with identical package names, you
want these packaged together.

I certainly see merits in both implementations.  I guess if this never
made it anywhere there's not a lot of need for a pre-compilation mojo.

Eric
On Fri, 2008-03-07 at 14:42 -0300, Fernando Meyer wrote:
 Hi Eric, 
 
 Someone already made a contrib of a maven plugin, I think I did some
 review on that code but it never went to mainstream. 
 could you please compare your code to the attachment? 
 http://jira.jboss.org/jira/browse/JBRULES-1273
 
 
 
 On Fri, Mar 7, 2008 at 1:22 PM, Eric Miles [EMAIL PROTECTED]
 wrote:
 I have not performed any tests on this, but I'm sure the
 Drools guys
 could comment on it as they provide serialized vs
 non-serialized support
 in the framework.  I would have to think it would decrease
 initialization time as you're only de-serializing objects vs
 compiling a
 rule set.  Of course, your build time will increase :)
 
 Our main goal was to limit the number (and size) of the jars
 we had to
 include in our application as we already had a very large
 distributable
 for our application.
 
 Some features of the compilation mojo:
 - Precompiles drls, ruleflow, and dsl into their individual
 packages
 - Supports single package being spread across multiple DRL and
 rule flow
 files using same package name.
 - Supports DSL through a specific naming convention (some work
 could be
 done here to be a little more flexible)
 - Supports compression to decrease serialized package file
 sizes
 (Currently gzip, could tweak to support other compressions)
 - Serializes via XStream (could be tweaked to support
 different
 serialization mechanisms)
 
 Eric
 
 
 On Fri, 2008-03-07 at 16:57 +0100, Geoffrey De Smet wrote:
  Sounds interesting.
  Does it noticeably decrease RuleBase initialization time at
 runtime?
 
  With kind regards,
  Geoffrey De Smet
 
 
  Eric Miles wrote:
   Is there a Maven Drools compilation mojo, provided either
 by the Drools
   team or some open source project?  If not, I have one that
 I'd be
   willing to submit.  I think it's pretty slick and would
 only require a
   few tweaks to truly make it useful (hard coded to
 currently use XStream
   serialization).
   ___
   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 mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
 -- 
 Fernando Meyer http://fmeyer.org
 JBoss Rules Core Developer
 [EMAIL PROTECTED] 
 ___
 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] Way to check rules in .drl without running them?

2008-03-07 Thread Christie, Blair
 

Is there a way plug-in or a a way to validate the rules in a .drl
without actually running the rule? 

 

 

Cheers,
Blair

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


[rules-users] Ant compiler task?

2008-03-07 Thread Eric Miles
I see numerous references to the Ant task in the documentation but see
no documentation on how to use it.  Where can I find some?  Google
turned up nothing...
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Ant compiler task?

2008-03-07 Thread Fernando Meyer
Basically you need to add the drools-ant on your classpath

define your compile task

taskdef name=rulebase
classname=org.drools.contrib.DroolsCompilerAntTask
classpathref=drools.classpath /

And use the rulebase task as the following example

target name=rules 
rulebase
srcdir=${eclipsepath}src/test/resources/rules 

tofile=${eclipsepath}target/cheese.rules
classpathref=cheese.classpath 
include name=*.drl /
include name=*.brl /
include name=*.xml /
include name=*.dslr /   
/rulebase
/target


you can see my test XML file here
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-ant/src/test/resources/DroolsAntTask.xml


On Fri, Mar 7, 2008 at 5:59 PM, Eric Miles [EMAIL PROTECTED] wrote:

 I see numerous references to the Ant task in the documentation but see
 no documentation on how to use it.  Where can I find some?  Google
 turned up nothing...
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
Fernando Meyer http://fmeyer.org
JBoss Rules Core Developer
[EMAIL PROTECTED]
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Hire a programmer from JBoss Rules

2008-03-07 Thread SB.Raghavendra
Please contact me.



On 3/7/08, Arjun Dhar [EMAIL PROTECTED] wrote:

 Hey guys,
 I reference of mine  is interested in hiring a JBoss Rules resource for a
 new
 venture. To ensure the person is good I'm not throwing this to the general
 public; is it possible to contact you guys?

 lemme know.

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




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