Re: [rules-users] Accum question

2007-07-27 Thread Mike D

Thanks Edson.  Yea, I typed it on the fly instead of cut/paste.  I will try
the inline eval.

Your help is appreciated!


Edson Tirelli-3 wrote:
 
Sorry, it is not clear what you are trying to do.
There are a few clear mistakes in your rule:
 
 1. You can't use the $totV variable inside the accumulate, since $totV is
 the result of the accumulate.
 
 2. You can't use variables bound inside accumulate outside of it, since
 accumulate is a scope delimiter ($ciNo, $ciLineNo).
 
 3. If you want to sum values, use sum() function, but if you want to count
 occurrences, use the count() function.
 
 4. This expression is wrong: $totV  1. You must either compare
 something
 to a field or use an eval()  (inlined or not) to evaluate arbitrary
 expressions.
 
 5. I think it is simply a typo, but since the DRL is case sensitive, the
 java class Number must be written with capital N.
 
Maybe if you can explain with more common terms what rule you are
 trying
 to write, we can help more... the best I could imagine is:
 
 rule 00910 Pass XV sets
   when
 $status : ValidationPassFailStatus()
 exists ValidationControl(validationNo == 910)
 CiLines( $ciNo : $ciNo, $ciLineNo : $ciLineNo, spiSecondary == X )
 Number( intValue  1 )
   from accumulate( $c : CiLines( ciNo == $ciNo, ciLineNo ==
 $ciLineNo,
  spiSecondary == V ),
count( $c ) )
  then
 $status.pass(910);
 end
 
Hope it helps.
 
Edson
 
 2007/7/27, Mike D [EMAIL PROTECTED]:


 Newbie question again...

 I'm trying to get a count of V lines if I have an X.  If more than 1 V
 line,
 I pass...  Obviously I can't have $totV on LHS, but you get my
 drift.  What
 is the correct syntax for this one?  I've been digging in the docs on
 accum,
 but can't find anything that fits what I'm trying to do.

 Thanks,
 Mike

 rule 00910 Pass XV sets
 when
 $status : ValidationPassFailStatus()
 exists ValidationControl(validationNo == 910)
 $totV  : number()
 from accumulate(CiLines($ciNo : $ciNo, $ciLineNo :
 ciLineNo, spiSecondary
 == V), sum($totV))
 CiLines(ciNo == $ciNo, ciLineNo == $ciLineNo,
 spiSecondary
 == X, $totV  1)
 then
 $status.pass(910);
 end


 --
 View this message in context:
 http://www.nabble.com/Accum-question-tf4157809.html#a11829193
 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

 
 
 
 -- 
   Edson Tirelli
   Software Engineer - JBoss Rules Core Developer
   Office: +55 11 3529-6000
   Mobile: +55 11 9287-5646
   JBoss, a division of Red Hat @ www.jboss.com
 
 ___
 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/Accum-question-tf4157809.html#a11830313
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


[rules-users] adding process to an empty rule base

2007-07-27 Thread hypnosat7

Is it possible to set the rule flow in my rule base before adding rule
packages :

ruleBase = RuleBaseFactory.newRuleBase();
org.drools.compiler.ProcessBuilder processBuilder = new ProcessBuilder(new
PackageBuilder());
processBuilder.addProcessFromFile(ruleFlow);
ruleBase.addProcess(processBuilder.getProcesses()[0]);

thanks
-- 
View this message in context: 
http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
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] adding process to an empty rule base

2007-07-27 Thread Kris Verlaenen
This error is caused by a mismatch between the version of the mvel library 
you are using and the version that is expected by drools.
Drools 4.0.0 is expecting mvel14-1.2rc1.jar.  Previous versions of drools 
are probably based on older versions of mvel.

Might also be caused by having multiple versions of mvel in your classpath.

Kris

- Original Message - 
From: hypnosat7 [EMAIL PROTECTED]

To: rules-users@lists.jboss.org
Sent: Friday, July 27, 2007 5:30 PM
Subject: Re: [rules-users] adding process to an empty rule base





I try this:
...
InputStream stream =
getClass().getResourceAsStream(/rules/demoRuleFlow.rfm);
Reader ruleFlowReader = new InputStreamReader(stream);
ruleEngine.setRuleFlow(ruleFlowReader);
..

PackageBuilder builder = new PackageBuilder();
builder.addRuleFlow(ruleFlow);
Package pkgRuleFlow = builder.getPackage();
ruleBase.addPackage(pkgRuleFlow);

but I have this error:
Caused by: java.lang.NoSuchMethodError:
org.mvel.optimizers.OptimizerFactory.setDefaultOptimizer(Ljava/lang/String;)V
at
org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:132)
at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:139)
at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:88)



Kris Verlaenen wrote:


Yes, that is possible, but you should also add the (generated) package of
your PackageBuilder.

But this process is actually much simpler when using the ProcessBuilder
exclusively.
It should look something like this:

PackageBuilder builder = new PackageBuilder();
// add your rules (if any)
builder.addPackageFromDrl( ... );
// add your processes (if any)
builder.addRuleFlow( ... );
// add Package to ruleBase
Package pkg = builder.getPackage(); // this includes all the rules and
processes
ruleBase.addPackage( pkg );

Kris

- Original Message - 
From: hypnosat7 [EMAIL PROTECTED]

To: rules-users@lists.jboss.org
Sent: Friday, July 27, 2007 3:59 PM
Subject: [rules-users] adding process to an empty rule base




Is it possible to set the rule flow in my rule base before adding rule
packages :

ruleBase = RuleBaseFactory.newRuleBase();
org.drools.compiler.ProcessBuilder processBuilder = new
ProcessBuilder(new
PackageBuilder());
processBuilder.addProcessFromFile(ruleFlow);
ruleBase.addProcess(processBuilder.getProcesses()[0]);

thanks
--
View this message in context:
http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
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


___
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/adding-process-to-an-empty-rule-base-tf4157978.html#a11831502

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 


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


Re: [rules-users] adding process to an empty rule base

2007-07-27 Thread hypnosat7


I try this:
...
InputStream stream =
getClass().getResourceAsStream(/rules/demoRuleFlow.rfm);
Reader ruleFlowReader = new InputStreamReader(stream);
ruleEngine.setRuleFlow(ruleFlowReader);
..

PackageBuilder builder = new PackageBuilder();
builder.addRuleFlow(ruleFlow);
Package pkgRuleFlow = builder.getPackage();
ruleBase.addPackage(pkgRuleFlow);

but I have this error:
Caused by: java.lang.NoSuchMethodError:
org.mvel.optimizers.OptimizerFactory.setDefaultOptimizer(Ljava/lang/String;)V
at
org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:132)
at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:139)
at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:88)



Kris Verlaenen wrote:
 
 Yes, that is possible, but you should also add the (generated) package of 
 your PackageBuilder.
 
 But this process is actually much simpler when using the ProcessBuilder 
 exclusively.
 It should look something like this:
 
 PackageBuilder builder = new PackageBuilder();
 // add your rules (if any)
 builder.addPackageFromDrl( ... );
 // add your processes (if any)
 builder.addRuleFlow( ... );
 // add Package to ruleBase
 Package pkg = builder.getPackage(); // this includes all the rules and 
 processes
 ruleBase.addPackage( pkg );
 
 Kris
 
 - Original Message - 
 From: hypnosat7 [EMAIL PROTECTED]
 To: rules-users@lists.jboss.org
 Sent: Friday, July 27, 2007 3:59 PM
 Subject: [rules-users] adding process to an empty rule base
 
 

 Is it possible to set the rule flow in my rule base before adding rule
 packages :

 ruleBase = RuleBaseFactory.newRuleBase();
 org.drools.compiler.ProcessBuilder processBuilder = new
 ProcessBuilder(new
 PackageBuilder());
 processBuilder.addProcessFromFile(ruleFlow);
 ruleBase.addProcess(processBuilder.getProcesses()[0]);

 thanks
 -- 
 View this message in context: 
 http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
 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 
 
 ___
 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/adding-process-to-an-empty-rule-base-tf4157978.html#a11831502
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] adding process to an empty rule base

2007-07-27 Thread hypnosat7

thanks, it works but now I have this :
Caused by: java.lang.NullPointerException
at
org.drools.compiler.PackageBuilder.addRuleFlowsToPackage(PackageBuilder.java:469)
at 
org.drools.compiler.PackageBuilder.getPackage(PackageBuilder.java:449)



Kris Verlaenen wrote:
 
 This error is caused by a mismatch between the version of the mvel library 
 you are using and the version that is expected by drools.
 Drools 4.0.0 is expecting mvel14-1.2rc1.jar.  Previous versions of drools 
 are probably based on older versions of mvel.
 Might also be caused by having multiple versions of mvel in your
 classpath.
 
 Kris
 
 - Original Message - 
 From: hypnosat7 [EMAIL PROTECTED]
 To: rules-users@lists.jboss.org
 Sent: Friday, July 27, 2007 5:30 PM
 Subject: Re: [rules-users] adding process to an empty rule base
 
 


 I try this:
 ...
 InputStream stream =
 getClass().getResourceAsStream(/rules/demoRuleFlow.rfm);
 Reader ruleFlowReader = new InputStreamReader(stream);
 ruleEngine.setRuleFlow(ruleFlowReader);
 ..

 PackageBuilder builder = new PackageBuilder();
 builder.addRuleFlow(ruleFlow);
 Package pkgRuleFlow = builder.getPackage();
 ruleBase.addPackage(pkgRuleFlow);

 but I have this error:
 Caused by: java.lang.NoSuchMethodError:
 org.mvel.optimizers.OptimizerFactory.setDefaultOptimizer(Ljava/lang/String;)V
 at
 org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:132)
 at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
 at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:139)
 at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:88)



 Kris Verlaenen wrote:

 Yes, that is possible, but you should also add the (generated) package
 of
 your PackageBuilder.

 But this process is actually much simpler when using the ProcessBuilder
 exclusively.
 It should look something like this:

 PackageBuilder builder = new PackageBuilder();
 // add your rules (if any)
 builder.addPackageFromDrl( ... );
 // add your processes (if any)
 builder.addRuleFlow( ... );
 // add Package to ruleBase
 Package pkg = builder.getPackage(); // this includes all the rules and
 processes
 ruleBase.addPackage( pkg );

 Kris

 - Original Message - 
 From: hypnosat7 [EMAIL PROTECTED]
 To: rules-users@lists.jboss.org
 Sent: Friday, July 27, 2007 3:59 PM
 Subject: [rules-users] adding process to an empty rule base



 Is it possible to set the rule flow in my rule base before adding rule
 packages :

 ruleBase = RuleBaseFactory.newRuleBase();
 org.drools.compiler.ProcessBuilder processBuilder = new
 ProcessBuilder(new
 PackageBuilder());
 processBuilder.addProcessFromFile(ruleFlow);
 ruleBase.addProcess(processBuilder.getProcesses()[0]);

 thanks
 -- 
 View this message in context:
 http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
 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

 ___
 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/adding-process-to-an-empty-rule-base-tf4157978.html#a11831502
 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 
 
 ___
 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/adding-process-to-an-empty-rule-base-tf4157978.html#a11832555
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] adding process to an empty rule base

2007-07-27 Thread hypnosat7

If I do like this, it works :

PackageBuilder builder = new PackageBuilder();
Reader drlReader = new
InputStreamReader(getClass().getResourceAsStream(/emptyPackage.drl));
builder.addPackageFromDrl(drlReader);
builder.addRuleFlow(ruleFlow);
Package pkgRuleFlow = builder.getPackage();
ruleBase.addPackage(pkgRuleFlow);

In the emptyPackage.drl file this no rules, but it seems to be impossible to
have a rule base with only a rule flow. I hope I'm wrong :)



hypnosat7 wrote:
 
 thanks, it works but now I have this :
 Caused by: java.lang.NullPointerException
   at
 org.drools.compiler.PackageBuilder.addRuleFlowsToPackage(PackageBuilder.java:469)
   at 
 org.drools.compiler.PackageBuilder.getPackage(PackageBuilder.java:449)
 
 
 
 Kris Verlaenen wrote:
 
 This error is caused by a mismatch between the version of the mvel
 library 
 you are using and the version that is expected by drools.
 Drools 4.0.0 is expecting mvel14-1.2rc1.jar.  Previous versions of drools 
 are probably based on older versions of mvel.
 Might also be caused by having multiple versions of mvel in your
 classpath.
 
 Kris
 
 - Original Message - 
 From: hypnosat7 [EMAIL PROTECTED]
 To: rules-users@lists.jboss.org
 Sent: Friday, July 27, 2007 5:30 PM
 Subject: Re: [rules-users] adding process to an empty rule base
 
 


 I try this:
 ...
 InputStream stream =
 getClass().getResourceAsStream(/rules/demoRuleFlow.rfm);
 Reader ruleFlowReader = new InputStreamReader(stream);
 ruleEngine.setRuleFlow(ruleFlowReader);
 ..

 PackageBuilder builder = new PackageBuilder();
 builder.addRuleFlow(ruleFlow);
 Package pkgRuleFlow = builder.getPackage();
 ruleBase.addPackage(pkgRuleFlow);

 but I have this error:
 Caused by: java.lang.NoSuchMethodError:
 org.mvel.optimizers.OptimizerFactory.setDefaultOptimizer(Ljava/lang/String;)V
 at
 org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:132)
 at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
 at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:139)
 at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:88)



 Kris Verlaenen wrote:

 Yes, that is possible, but you should also add the (generated) package
 of
 your PackageBuilder.

 But this process is actually much simpler when using the ProcessBuilder
 exclusively.
 It should look something like this:

 PackageBuilder builder = new PackageBuilder();
 // add your rules (if any)
 builder.addPackageFromDrl( ... );
 // add your processes (if any)
 builder.addRuleFlow( ... );
 // add Package to ruleBase
 Package pkg = builder.getPackage(); // this includes all the rules and
 processes
 ruleBase.addPackage( pkg );

 Kris

 - Original Message - 
 From: hypnosat7 [EMAIL PROTECTED]
 To: rules-users@lists.jboss.org
 Sent: Friday, July 27, 2007 3:59 PM
 Subject: [rules-users] adding process to an empty rule base



 Is it possible to set the rule flow in my rule base before adding rule
 packages :

 ruleBase = RuleBaseFactory.newRuleBase();
 org.drools.compiler.ProcessBuilder processBuilder = new
 ProcessBuilder(new
 PackageBuilder());
 processBuilder.addProcessFromFile(ruleFlow);
 ruleBase.addProcess(processBuilder.getProcesses()[0]);

 thanks
 -- 
 View this message in context:
 http://www.nabble.com/adding-process-to-an-empty-rule-base-tf4157978.html#a11829714
 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

 ___
 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/adding-process-to-an-empty-rule-base-tf4157978.html#a11831502
 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 
 
 ___
 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/adding-process-to-an-empty-rule-base-tf4157978.html#a11833321
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


[rules-users] Something going on with maven2 repo?

2007-07-27 Thread Eric Miles
I'm trying to attempt to upgrade to 4.0.0 GA again and it looks like the
org.drools:drools:4.0.0 artifact is missing on the server.  However,
unlike yesterday, the core and compiler artifacts now have poms and
checksums (which I think was the issue yesterday).  Is the release not
fully available on the repo yet?

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


Re: [rules-users] Something going on with maven2 repo?

2007-07-27 Thread Fernando Meyer

Hey Eric,

	It takes a few minutes to sync maven2 repository with subversion,  
please try again in a few minutes.


Cheers

Fernando Meyer http://fmeyer.org
[EMAIL PROTECTED]
PGP: 0xD804DDFB



On Jul 27, 2007, at 2:45 PM, Eric Miles wrote:

I'm trying to attempt to upgrade to 4.0.0 GA again and it looks  
like the org.drools:drools:4.0.0 artifact is missing on the  
server.  However, unlike yesterday, the core and compiler artifacts  
now have poms and checksums (which I think was the issue  
yesterday).  Is the release not fully available on the repo yet?


Thanks,
Eric
___
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] Problems running brms

2007-07-27 Thread Fernando Meyer

Aziz,

It was a problem with our last build, please download the latest brms  
war from http://labs.jboss.com/drools/downloads


Regards

Fernando Meyer http://fmeyer.org
[EMAIL PROTECTED]
PGP: 0xD804DDFB



On Jul 27, 2007, at 6:17 PM, Aziz Boxwala wrote:

I am having a problem running brms. I cannot view any part of the  
web page except the mast head.


I earlier had downloaded and tried out brms 4.0 MR3 and it appeared  
to work fine. I then downloaded a continuous build release and  
subsequently the 4.0.0 release. In both of these, I encountered the  
problem.


I am running the brms under JBoss AS 4.2 on Windows Vista. I have  
used IE 7, Firefox 2.0.0.5 and Safari as the browser.


--Aziz

___
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] Problems running brms

2007-07-27 Thread Aziz Boxwala
That solved the problem. Thanks.

--Aziz

Fernando Meyer [EMAIL PROTECTED] wrote:  Aziz, 


It was a problem with our last build, please download the latest brms war from 
http://labs.jboss.com/drools/downloads
 

Regards 

 Fernando Meyer http://fmeyer.org
[EMAIL PROTECTED]
PGP: 0xD804DDFB




 

On Jul 27, 2007, at 6:17 PM, Aziz Boxwala wrote:

I am having a problem running brms. I cannot view any part of the web page 
except the mast head.

I earlier had downloaded and tried out brms 4.0 MR3 and it appeared to work 
fine. I then downloaded a continuous build release and subsequently the 4.0.0 
release. In both of these, I encountered the problem.

I am running the brms under JBoss AS 4.2 on Windows Vista. I have used IE 7, 
Firefox 2.0.0.5 and Safari as the browser.

--Aziz

___
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