[rules-users] How to validate boolean values..using Drools

2008-06-17 Thread manyasri.m

 Hi,
 
In My Employee Table column name HostVisible_YN. HostVisible_YN it's boolen
value.

Condtion is: HostVisible_YN column value must be Y or N.


How to validate this condition using drools..


Thnks,
Manya...
-- 
View this message in context: 
http://www.nabble.com/How-to-validate-boolean-values..using-Drools-tp17882303p17882303.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


[rules-users] RuleFlow Groups and retraction

2008-06-17 Thread Markus Helbig
Hi,

one question about using ruleflows:

1. i have a ruleflow consisting of 2 Nodes
2. i insert 2 facts
3. the 2 facts match the condition in rule for the second node, so
when inserting an activation is generated
4. but the rule in the first node will retract one of the 2 facts
5. it seems the activation for the second node is not cancelled also i
do a retract in the rule
6. now the activation in second node tries to execute and results in a
NullpointerException

What do i do wrong?

Cheers

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


[rules-users] EPL relicense for eclipse tooling

2008-06-17 Thread Mark Proctor
I'm contemplating EPLing the Eclipse tooling, anyone have any opions on 
this, good or bad?


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


[rules-users] Re: How to validate boolean values..using Drools

2008-06-17 Thread Alexander Claus
In My Employee Table column name HostVisible_YN. HostVisible_YN it's 
boolen

value.

Condtion is: HostVisible_YN column value must be Y or N.


How to validate this condition using drools..


Hi Manya,

feel free to experiment with the DRL language! A simple test gave, that the 
most intuitive solution is possible:

$value in (Y, N)
Here you can read more: 
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch06s05.html#d0e3166

See section on Compound Value Restriction for details.

Alternatively you could use
$value == Y || N
which is the simplest solution which you should (!) have found even as a 
beginner as I am.

Again: experiment with the language!

Alexander Claus 


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


[rules-users] Changing DSL in BRMS

2008-06-17 Thread Richard Ambridge

Hi,

I have a DSL defined in BRMS

that says for example..

[when]The cat sat on the mat=Object(moose)


and then loads of rules defined that are using that DSL..

Now the business wants to change the words so that the DSL reads

[when]The dog sat on the mat=Object(moose)

That is easy to do, as I just edit the DSL..
but none of the rules change... and there are lots of them... now all 
the rules fail validation


How can I search and replace the DSL in the rules?

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


[rules-users] Running Drools 4 examples

2008-06-17 Thread Ron Kneusel

Greetings!

I am attempting to run the HelloWorld example for Drools 4.  I have Eclipse 3.3 
setup on Windows with the Drools plugin.  I have created a project with the 
Drools examples and added all the Drools .jar files to the project.  Everything 
compiles.  When I initially ran HelloWorldExample.java it appeared that it 
could not find the HelloWorld.drl file.  So, I moved that file into the same 
directory as HelloWorldExample.java and ran again.  This time I am getting an 
error that the JDT compiler is not found even though it appears that there are 
JDT jar files in the Eclipse plugins.

I also attempted to run this example under Linux from the command line.  In 
this case I placed all the Drools .jar files into the JRE ext folder and 
changed the source code to use the Janino compiler by adding:

//  Set up for the Janino compiler, not Eclipse
System.setProperty(drools.dialect.java.compiler, JANINO);
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration();
JavaDialectConfiguration javaConf = 
(JavaDialectConfiguration)cfg.getDialectConfiguration(java);

This version compiles with javac and runs with java -cp . HelloWorldExample but 
gives me an error within the compiler while compiling the .drl file:

Exception in thread main java.lang.StringIndexOutOfBoundsException: String 
index out of range: -1
at java.lang.String.substring(String.java:1938)
at 
org.drools.base.ClassTypeResolver.importClass(ClassTypeResolver.java:242)
at 
org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:158)
at 
org.drools.rule.builder.dialect.mvel.MVELDialect.addImport(MVELDialect.java:257)
at 
org.drools.compiler.DialectRegistry.addImport(DialectRegistry.java:98)
at 
org.drools.compiler.PackageBuilder.mergePackage(PackageBuilder.java:377)
at 
org.drools.compiler.PackageBuilder.newPackage(PackageBuilder.java:350)
at 
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:267)
at 
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
at HelloWorldExample.main(HelloWorldExample.java:39)

It is dying on this line:

builder.addPackageFromDrl( source );

My version of HelloWorldExample.java the same as the given example except for 
the addition of the lines above for Janino.  My ultimate goal is to run this 
all under Linux, I am not an Eclipse user.

Any help getting this working would be greatly appreciated!

Ron



_
Introducing Live Search cashback .  It's search that pays you back!
http://search.live.com/cashback/?pkw=form=MIJAAF/publ=HMTGL/crea=introsrchcashback
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] how to find which condition evaluated to TRUE?

2008-06-17 Thread Marina
Hello,

If I have a complex rule with a few conditions concatenated via AND and OR and 
NOT, and the rule evaluated to true during the engine run - is there a way to 
figure out which of the conditions caused the rule to evaluate to true?

In a simple example:
rule test1
dialect java
when
$data : ContractRulesData (region=='NE'  sum  250)
then
approverList.add(approver1, approver2, Level1);
System.out.println(test1 is TRUE; result: approver1, approver2, 
Level1);
end

I tried to add an AgendaListener with the following code to find out which 
rules have fired:
public void afterActivationFired(AfterActivationFiredEvent event, 
WorkingMemory workingMemory) {
Activation activation = event.getActivation();
Rule rule = activation.getRule();
GroupElement[] leftElements = rule.getTransformedLhs();
System.out.println(afterActivationFired: rule =  + rule.getName());
System.out.println(Conditions: );
for (GroupElement left_el: leftElements){
System.out.println(left_el.toString());
}

The output is somewhat cryptic :
afterActivationFired: rule = test1
Conditions: 
AND[Pattern type='[ClassObjectType 
class=com.emptoris.ecm.domain.ContractRulesData]', index='0', offset='0', 
identifer='[Declaration: type=ValueType = 'Object' identifier=$data]']

So, is there a way to get even more information about the conditions and 
whether they evaluated to TRUE or FALSE?


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


Re: [rules-users] No accumulator function found for identifier

2008-06-17 Thread Barry Kaplan

Is there any other magic for the IDE to see this file? With
drools.packagebuilder.conf in my windows home directory I still get the IDE
error. 

Also, for my environment I'm not using a property file at runtime -- I
create the properties in code and construct a PackageBuilderConfiguration.
It would be nice if there was another way to configure the IDE that is
compatible for this supported use of the API.

-barry

-- 
View this message in context: 
http://www.nabble.com/No-accumulator-function-found-for-identifier-tp17339463p17932670.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


[rules-users] Rule is firing on those objects for which that has already fired

2008-06-17 Thread siddhartha banik
 Hi All,

I am using Drools Stateful session with serialized Rule Base  Working
memory for my application. I need to write some rule which will *only* fire
on newly inserted data points in Working Memory. Does Drools support any
such feature which will help me to achieve this ? Any suggestion, how can I
achieve this efficiently?


As sample, I have written a rule bellow:

global RuleSetOutput ruleSetOutput
 rule sample_rule
 when
  (p4: DataObject(id == 4, stringValue == 230007014)) and
  (p14: DataObject(id == 14, stringValue == 230007004)) and
  (p10: DataObject(id == 10, stringValue == 230007005)) and
  (p11: DataObject(id == 11, stringValue == 230007006)) and
  (p12: DataObject(id == 12, stringValue == 230007007)) and
  (p13: DataObject(id == 13, stringValue == 230007008))
 then
  String ruleID = sample_rule;
  RuleOutput ruleOutput =
RuleEngineHelper.getRuleOutput(ruleSetOutput, ruleID);
  ruleOutput.addDataObject(p13);
  ruleOutput.addDataObject(p4);
  ruleOutput.addDataObject(p11);
  ruleOutput.addDataObject(p14);
  ruleOutput.addDataObject(p10);
  ruleOutput.addDataObject(p12);
end

For 1st execution, I am inserting 6 matching DataObjects into Working
Memory. Rule is getting fired once  those 6 data points are getting added
into RuleOutput.

But in subsequent rule executions after I insert 6 more matching DataObjects
into Working Memory, Rule is getting fired couple of times   objects from
old executions also getting appended to the current RuleOutput.

How can I avoid this ?

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


[rules-users] Different working memories/rulebases for different application issues?

2008-06-17 Thread thomaskukofka

Hi,

I'm quite a beginner with Drools and I want to integrate Drools in our 
application. The application could use rules for different smaller 
issues which use partly different facts as input. My question is if I 
should use different rulebases or working memories for each issue or is 
on rulesbase contiaining all rules which then refers to different fact 
tyes and one session is enough? does it make sense to bundle the rules 
for each issue in an own agenda group?


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


[rules-users] wrapping drools api?

2008-06-17 Thread thomaskukofka

Hello,

some people write about wrapping the Drools API with an own access API 
for integration in the application.
Sorry for the perhaps stupid question, but what is the reason for this? 
Does this only make sense if  I'm thinking about changing the rule 
engine one day?
If I'm not intending to change the rule engine from Drools to another, 
so isn't it the same if the developpers has to use the native Drools API 
or an self-written access API?


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


Re: [rules-users] wrapping drools api?

2008-06-17 Thread Mark Proctor

[EMAIL PROTECTED] wrote:

Hello,

some people write about wrapping the Drools API with an own access API 
for integration in the application.
Sorry for the perhaps stupid question, but what is the reason for 
this? Does this only make sense if  I'm thinking about changing the 
rule engine one day?

yes they do this for rule engine independance.
If I'm not intending to change the rule engine from Drools to another, 
so isn't it the same if the developpers has to use the native Drools 
API or an self-written access API?


Regards
Tom
___
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] EPL relicense for eclipse tooling

2008-06-17 Thread Steven Núñez
Stay with BSD-style license No need to muddy the waters...


On 18/06/08 12:31 AM, Mark Proctor [EMAIL PROTECTED] wrote:

 I'm contemplating EPLing the Eclipse tooling, anyone have any opions on
 this, good or bad?
 
 Mark
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

-- 

Level 3
85 Macquarie Street
Hobart TAS 7000
Australia

Phone:  +61 3 6270 2276
Mobile: +61 4 0096 4240
Fax: +61 3 6270 2223
http://illation.com.au


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


Re: [rules-users] EPL relicense for eclipse tooling

2008-06-17 Thread Mark Proctor

Steven Núñez wrote:

Stay with BSD-style license No need to muddy the waters...
  
We'll its not quite as simple as that. All other JBoss tooling is EPL 
and Drools stuff isn't, it's ASL. However the new synchronisation code 
for the repository is considered generic tooling and they want to put 
this under the EPL, as it's not owned by Drools team. Mixing EPL and 
other license in the same svn repository is apparently a bad idea, so 
I've had a request from the JBoss Tools people to do a complete 
re-license to make things easier. Now we can continue with the Drools 
owned parts staying ASL and other bits being EPL, but you'll still have 
a product with muddy waters due to mixed licensing - I think it's 
unlikely I'll win the argument to ASL any generic parts if they happened 
to be used with Drools. But I wanted to put this out to the community 
for open debate on the pros and cons. I don't consider the EPL to have 
the same political issues to the LGPL, so I'm personally less concerned 
about the political issues.


On 18/06/08 12:31 AM, Mark Proctor [EMAIL PROTECTED] wrote:

  

I'm contemplating EPLing the Eclipse tooling, anyone have any opions on
this, good or bad?

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