[rules-users] drools-eclipse sources?

2008-07-03 Thread Markus Helbig
Hi everybody,

where can i get the sources for drools-eclipse? I remember they were
in svn but currently i can't find them there.

Cheers

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


Re: [rules-users] drools-eclipse sources?

2008-07-03 Thread Marcus Ilgner
On Thu, Jul 3, 2008 at 8:23 AM, Markus Helbig [EMAIL PROTECTED] wrote:
 Hi everybody,

 where can i get the sources for drools-eclipse? I remember they were
 in svn but currently i can't find them there.

 Cheers

 Markus

Hi Markus,

have a look at 
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-eclipse/

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


Re: [rules-users] how to find the rule name

2008-07-03 Thread Scott Burrows
The RHS of the rule uses Java syntax, so you need to declare all vars.  You
need to declare rulename as a String.

Scott Burrows
407-739-7752

On Wed, Jul 2, 2008 at 5:09 PM, Marina [EMAIL PROTECTED] wrote:

 Hello,

 I need to know the rule name of the rule that fired in the consequence part
 of the rule. I tried something like the following, just trying to see if I
 can get it this way:

 package mode.simple;
 import java.lang.String;
 import java.util.List;
 import com.emptoris.ecm.domain.ContractRulesData;

 global java.util.Set approverList;

 rule testOR_1
dialect java
when
$data : ContractRulesData (sum  500 || name matches .*important)
then
approverList.add(approver3, approver4, Level5);
ruleName = drools.getRule().getName();
System.out.println(ruleName +  is TRUE);

 end

 When I'm trying to compile the rule, I'm getting the following error:
 Builder errors:
 Rule Compilation error : [Rule name=testOR_1, agendaGroup=MAIN, salience=0,
 no-loop=false]
mode/simple/Rule_testOR_1_0.java (8:391) : ruleName cannot be resolved
mode/simple/Rule_testOR_1_0.java (9:452) : ruleName cannot be resolved
 java.lang.RuntimeException: Unable to compile rules file: testOR_1.drl

 I must be doing something wrong here... ?

 thanks!
 Marina
 ___
 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] how to find the rule name

2008-07-03 Thread Marina
Thanks, Steven, Scott,
yes, that worked. The reason I did not do it in the first place is because I 
was looking for examples of variable declaration in RHS and the only one I 
found was the PetStore.drl:
then
System.out.println( Adding free Fish Food Sample to cart );
purchase = new Purchase($order, $fishFoodSample);
insert( purchase );
$order.addItem( purchase );

Since the 'purchase' object was not declared using Java syntax I assumed that 
is the Drools syntax... Maybe it's a typo in the example? I did not run it 
myself.

Anyway, it works now :-)

Thanks!
Marina



- Original Message 
From: Scott Burrows [EMAIL PROTECTED]
To: Rules Users List rules-users@lists.jboss.org
Sent: Thursday, July 3, 2008 8:10:35 AM
Subject: Re: [rules-users] how to find the rule name

The RHS of the rule uses Java syntax, so you need to declare all vars.  You 
need to declare rulename as a String.

Scott Burrows
407-739-7752 


On Wed, Jul 2, 2008 at 5:09 PM, Marina [EMAIL PROTECTED] wrote:

Hello,

I need to know the rule name of the rule that fired in the consequence part of 
the rule. I tried something like the following, just trying to see if I can get 
it this way:

package mode.simple;
import java.lang.String;
import java.util.List;
import com.emptoris.ecm.domain.ContractRulesData;

global java.util.Set approverList;

rule testOR_1
   dialect java
   when
   $data : ContractRulesData (sum  500 || name matches .*important)
   then
   approverList.add(approver3, approver4, Level5);
   ruleName = drools.getRule().getName();
   System.out.println(ruleName +  is TRUE);

end

When I'm trying to compile the rule, I'm getting the following error:
Builder errors:
Rule Compilation error : [Rule name=testOR_1, agendaGroup=MAIN, salience=0, 
no-loop=false]
   mode/simple/Rule_testOR_1_0.java (8:391) : ruleName cannot be resolved
   mode/simple/Rule_testOR_1_0.java (9:452) : ruleName cannot be resolved
java.lang.RuntimeException: Unable to compile rules file: testOR_1.drl

I must be doing something wrong here... ?

thanks!
Marina
___
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] insert a collection/ArrayList of facts

2008-07-03 Thread thomas kukofka
Hello,

is it possible to insert an Arraylist of facts like this?:

ArraList list;
wm.insert (list);

And if yes how can I iterate over the list in the when-part of the rule?
The rule should be applied to all elements of the inserted list.

A short drl-example would be perfect.

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


Re: [rules-users] insert a collection/ArrayList of facts

2008-07-03 Thread Marcus Ilgner
On Thu, Jul 3, 2008 at 2:55 PM, thomas kukofka [EMAIL PROTECTED] wrote:
 Hello,

 is it possible to insert an Arraylist of facts like this?:

 ArraList list;
 wm.insert (list);

 And if yes how can I iterate over the list in the when-part of the rule?
 The rule should be applied to all elements of the inserted list.

 A short drl-example would be perfect.

 Kind Regards
 Thomas


Hi Thomas,

I'm not sure if this is what you want but I think this should work:

rule ItemsFromList
when
  $list : List();
  $item : MyObject() from $list;
then
  // do something
end

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


RE: [rules-users] Drools optimization

2008-07-03 Thread Quinn, Dan
Hello All,

  I am implementing a Rules Engine with Drools that has a fact count in
the millions. I have tried to remove some of the facts from the system
to cut down on my load. To do this, a layer has been place over Drools
that filters out facts before they enter the system. 

  This approach helps a bit, but it has introduced a new problem. To
determine which facts should make their way into the system, a large
number a queries are run against working memory. I have placed a fact
counter into my system and it suggests every query is inserted into the
system as a fact. Due to the large number of queries, the fact counter
reported over 40 fact queries were placed into the system. This
accounts for 40+% of the facts in the system. 
 
  This leads me to a couple of questions. First, is the fact counter
giving me accurate information? Do all of the queries get entered into
working memory, and stay there? Secondly, if all these queries are
entered into the system, and stay there, does it effect performance? If
that's true, are the queries eventually removed, or do I have to do
something explicit to remove them?

  If anyone has other recommendations for optimizing large fact counts
please let me know.

Thanks for your time,
Dan

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marcus Ilgner
Sent: Thursday, July 03, 2008 9:24 AM
To: Rules Users List
Subject: Re: [rules-users] insert a collection/ArrayList of facts

On Thu, Jul 3, 2008 at 2:55 PM, thomas kukofka [EMAIL PROTECTED]
wrote:
 Hello,

 is it possible to insert an Arraylist of facts like this?:

 ArraList list;
 wm.insert (list);

 And if yes how can I iterate over the list in the when-part of the
rule?
 The rule should be applied to all elements of the inserted list.

 A short drl-example would be perfect.

 Kind Regards
 Thomas


Hi Thomas,

I'm not sure if this is what you want but I think this should work:

rule ItemsFromList
when
  $list : List();
  $item : MyObject() from $list;
then
  // do something
end

Best regards
Marcus
___
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] RE: Function Compilation Error when using JANINO

2008-07-03 Thread Garde, Varun (Equity Linked Technology)
Oh that was my bad, should have checked JANINO specs and saved
everyone's time. 

Thanks a ton!


Varun.


This message w/attachments (message) may be privileged, confidential or 
proprietary, and if you are not an intended recipient, please notify the 
sender, do not use or share it and delete it. Unless specifically indicated, 
this message is not an offer to sell or a solicitation of any investment 
products or other financial product or service, an official confirmation of any 
transaction, or an official statement of Merrill Lynch. Subject to applicable 
law, Merrill Lynch may monitor, review and retain e-communications (EC) 
traveling through its networks/systems. The laws of the country of each 
sender/recipient may impact the handling of EC, and EC may be archived, 
supervised and produced in countries other than the country in which you are 
located. This message cannot be guaranteed to be secure or error-free. This 
message is subject to terms available at the following link: 
http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you 
consent to the foregoing.


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


[rules-users] transitive closure

2008-07-03 Thread Paul Fodor
Dear Sir,

I am new to Drools and I want to ask how can I implement the classical
transitive closure in Drools. For instance we have a bunch of facts
edge/2 and the transitive closure:

reach(X,Y):- edge(X,Y).
reach(X,Y):- edge(X,Z),reach(Z,Y).

Should I create classes Edge and Reach with attributes source and target?

rule reachDirect
when
exists( Edge(X,Y) )
then
insertLogical( new Reach(X,Y) );
end

rule reachIndirect
when
exists( Edge(X,Z) )
exists( Reach(Z,Y) )
then
insertLogical( new Reach(X,Y) );
end

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


[rules-users] Re: transitive closure

2008-07-03 Thread Paul Fodor
On Thu, Jul 3, 2008 at 3:56 PM, Paul Fodor [EMAIL PROTECTED] wrote:
 Dear Sir,

 I am new to Drools and I want to ask how can I implement the classical
 transitive closure in Drools. For instance we have a bunch of facts
 edge/2 and the transitive closure:

 reach(X,Y):- edge(X,Y).
 reach(X,Y):- edge(X,Z),reach(Z,Y).

My current version looks like the following, but it never terminates.
It re-derives reach(c,c) forever.

TransitiveClosure.drl :
package org.drools.examples

import org.drools.examples.TransitiveClosureExample.Edge;
import org.drools.examples.TransitiveClosureExample.Reach;

rule reachDirect
salience 10
when
e : Edge(s1 : source, t1 : target)
not( Reach(source == s1, target == t1) )
then
insertLogical( new Reach(e.getSource(),e.getTarget()) );
System.out.println( Reach  + e.getSource() + , + e.getTarget() );
end

rule reachIndirect
salience 10
when
e : Edge(s1 : source, t1 : target)
r : Reach(t2 : target, source == t1 )
not( Reach(source == s1, target == t2) )
then
insertLogical( new Reach(e.getSource(),r.getTarget()) );
System.out.println( Reach  + e.getSource() + , + r.getTarget() );
end

TransitiveClosureExample.java :

package org.drools.examples;
import java.io.InputStreamReader;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.StatefulSession;
import org.drools.audit.WorkingMemoryFileLogger;
import org.drools.compiler.PackageBuilder;
import org.drools.compiler.PackageBuilderConfiguration;

public class TransitiveClosureExample {
public static void main(final String[] args) throws Exception {
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
final PackageBuilder builder = new PackageBuilder( conf );
builder.addPackageFromDrl( new InputStreamReader(
TransitiveClosureExample.class.getResourceAsStream(
TransitiveClosure.drl ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final StatefulSession session = ruleBase.newStatefulSession();
final WorkingMemoryFileLogger logger = new
WorkingMemoryFileLogger( session );
logger.setFileName( log/transitiveClosure );

final Edge edgeAB = new Edge( a,b );
final Edge edgeBC = new Edge( b,c );
final Edge edgeCD = new Edge( c,d );

session.insert( edgeAB );
session.insert( edgeBC );
session.insert( edgeCD );

session.fireAllRules();
logger.writeToDisk();
session.dispose();
}

public static class Edge {
private String source;
private String target;
public Edge() {}
public Edge(String source, String target) {
super();
this.source = source;
this.target = target;
}
public String getSource() {
return source;
}
public String getTarget() {
return source;
}
}

public static class Reach {
private String source;
private String target;
public Reach() {}
public Reach(String source, String target) {
super();
this.source = source;
this.target = target;
}
public void setSource(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setTarget(String target) {
this.target = target;
}
public String getTarget() {
return target;
}
}
}

Any sugestion?

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


[rules-users] Re: transitive closure

2008-07-03 Thread Paul Fodor
Even if the package says org.drools.examples, these files are not in
the Drools examples. I am just using that package to write these files
into while testing in Eclipse.

On Thu, Jul 3, 2008 at 4:31 PM, Paul Fodor [EMAIL PROTECTED] wrote:
 On Thu, Jul 3, 2008 at 3:56 PM, Paul Fodor [EMAIL PROTECTED] wrote:
 Dear Sir,

 I am new to Drools and I want to ask how can I implement the classical
 transitive closure in Drools. For instance we have a bunch of facts
 edge/2 and the transitive closure:

 reach(X,Y):- edge(X,Y).
 reach(X,Y):- edge(X,Z),reach(Z,Y).

 My current version looks like the following, but it never terminates.
 It re-derives reach(c,c) forever.

 TransitiveClosure.drl :
 package org.drools.examples

 import org.drools.examples.TransitiveClosureExample.Edge;
 import org.drools.examples.TransitiveClosureExample.Reach;

 rule reachDirect
salience 10
when
e : Edge(s1 : source, t1 : target)
not( Reach(source == s1, target == t1) )
then
insertLogical( new Reach(e.getSource(),e.getTarget()) );
System.out.println( Reach  + e.getSource() + , + e.getTarget() );
 end

 rule reachIndirect
salience 10
when
e : Edge(s1 : source, t1 : target)
r : Reach(t2 : target, source == t1 )
not( Reach(source == s1, target == t2) )
then
insertLogical( new Reach(e.getSource(),r.getTarget()) );
System.out.println( Reach  + e.getSource() + , + r.getTarget() );
 end

 TransitiveClosureExample.java :

 package org.drools.examples;
 import java.io.InputStreamReader;
 import org.drools.RuleBase;
 import org.drools.RuleBaseFactory;
 import org.drools.StatefulSession;
 import org.drools.audit.WorkingMemoryFileLogger;
 import org.drools.compiler.PackageBuilder;
 import org.drools.compiler.PackageBuilderConfiguration;

 public class TransitiveClosureExample {
public static void main(final String[] args) throws Exception {
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
final PackageBuilder builder = new PackageBuilder( conf );
builder.addPackageFromDrl( new InputStreamReader(
 TransitiveClosureExample.class.getResourceAsStream(
 TransitiveClosure.drl ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final StatefulSession session = ruleBase.newStatefulSession();
final WorkingMemoryFileLogger logger = new
 WorkingMemoryFileLogger( session );
logger.setFileName( log/transitiveClosure );

final Edge edgeAB = new Edge( a,b );
final Edge edgeBC = new Edge( b,c );
final Edge edgeCD = new Edge( c,d );

session.insert( edgeAB );
session.insert( edgeBC );
session.insert( edgeCD );

session.fireAllRules();
logger.writeToDisk();
session.dispose();
}

public static class Edge {
private String source;
private String target;
public Edge() {}
public Edge(String source, String target) {
super();
this.source = source;
this.target = target;
}
public String getSource() {
return source;
}
public String getTarget() {
return source;
}
}

public static class Reach {
private String source;
private String target;
public Reach() {}
public Reach(String source, String target) {
super();
this.source = source;
this.target = target;
}
public void setSource(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setTarget(String target) {
this.target = target;
}
public String getTarget() {
return target;
}
}
 }

 Any sugestion?

 Regards,
  Paul Fodor

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


[rules-users] Re: transitive closure

2008-07-03 Thread Paul Fodor
How can I check if an instance was not already inserted?

For instance, my transitive closure works for non-cycled data, but it
re-derives the same relations for cycled data.

TransitiveClosure.drl:
package org.drools.examples

import org.drools.examples.TransitiveClosureExample.Edge;
import org.drools.examples.TransitiveClosureExample.Reach;

rule reachDirect
salience 10
when
e : Edge(s1 : source, t1 : target)
//not( exists( Reach(source == s1, target == t1) ) )
then
insertLogical( new Reach(e.getSource(),e.getTarget()) );
System.out.println( Reach  + e.getSource() + , + e.getTarget() );
end

rule reachIndirect
salience 10
when
e : Edge(s1 : source, t1 : target)
r : Reach(t2 : target, source == t1 )
//not( exists( Reach(source == s1, target == t2) ) )
then
insertLogical( new Reach(e.getSource(),r.getTarget()) );
System.out.println( Reach  + e.getSource() + , + r.getTarget() );
end

TransitiveClosureExample.java:
package org.drools.examples;
import java.io.InputStreamReader;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.StatefulSession;
import org.drools.audit.WorkingMemoryFileLogger;
import org.drools.compiler.PackageBuilder;
import org.drools.compiler.PackageBuilderConfiguration;

public class TransitiveClosureExample {
public static void main(final String[] args) throws Exception {
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
final PackageBuilder builder = new PackageBuilder( conf );
builder.addPackageFromDrl( new InputStreamReader(
TransitiveClosureExample.class.getResourceAsStream(
TransitiveClosure.drl ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final StatefulSession session = ruleBase.newStatefulSession();
final WorkingMemoryFileLogger logger = new
WorkingMemoryFileLogger( session );
logger.setFileName( log/transitiveClosure );

final Edge edgeAB = new Edge( a,b );
final Edge edgeBC = new Edge( b,c );
final Edge edgeCD = new Edge( c,d );
final Edge edgeDA = new Edge( d,a );

session.insert( edgeAB );
session.insert( edgeBC );
session.insert( edgeCD );
session.insert( edgeDA );

session.fireAllRules();
logger.writeToDisk();
session.dispose();
}

public static class Edge {
private String source;
private String target;
public Edge() {}
public Edge(String source, String target) {
super();
this.source = source;
this.target = target;
}
public String getSource() {
return source;
}
public String getTarget() {
return target;
}
}

public static class Reach {
private String source;
private String target;
public Reach() {}
public Reach(String source, String target) {
super();
this.source = source;
this.target = target;
}
public void setSource(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setTarget(String target) {
this.target = target;
}
public String getTarget() {
return target;
}
}
}

Please tell me if you have any idea.
Thanks,
Paul Fodor
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Comparing Strings (sort order)

2008-07-03 Thread Charles Binford
I'm trying to figure out how to compare strings in drools.  I'd prefer 
to just be able to say something like:

when
 obj(member  string)


This doesn't work because the  or  operations are not allowed (though 
I saw in a May 6th post Edson gave a pointer to how to add it.)  Next I 
tried using eval().  Based on everything I've read this should work.  My 
problem is getting the syntax correct.  My object ActionArchive has a 
member called mediaPool.  I'd like to choose the one with the lowest 
(alphabetically) mediaPool string.


Try one.
rule testme
   when
   $ar : ActionArchive($mp : mediaPool)
   not (eval (ActionArchive(getMediaPool().CompareTo($mp))  0))
   then
   System.out.println(low mp=  + $ar.getMediaPool());
end
---
Rule Compilation error : [Rule name=junk, agendaGroup=MAIN, salience=0, 
no-loop=false]
   rules/Rule_testme_0.java (8:997) : The method getMediaPool() is 
undefined for the type Rule_junk_0



Try two..
rule testme
   when
   $ar : ActionArchive($mp : mediaPool)
   not (eval (ActionArchive(mediaPool.CompareTo($mp))  0))
   then
   System.out.println(low mp=  + $ar.getMediaPool());
end
---
Rule Compilation error : [Rule name=testme, agendaGroup=MAIN, 
salience=0, no-loop=false]

   rules/Rule_testme_0.java (8:999) : mediaPool cannot be resolved

Thanks for any pointers.
Charles
p.s. consider this a vote for adding   support for Strings
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: transitive closure

2008-07-03 Thread Edson Tirelli
   You will have to use regular insert() instead of insertLogical(). This is
because:

rule reachDirect
   salience 10
   when
   e : Edge(s1 : source, t1 : target)
   not( Reach(source == s1, target == t1) )
   then
   insertLogical( new Reach(e.getSource(),e.getTarget()) );
   System.out.println( Reach  + e.getSource() + , + e.getTarget() );
end

   Is initially true, but once the consequence is executed, the insert(new
Reach()) will cause the pattern not(Reach(...)) to become false and so the
object is retracted, causing the recursion.

   []s
   Edson


2008/7/3, Paul Fodor [EMAIL PROTECTED]:

 On Thu, Jul 3, 2008 at 3:56 PM, Paul Fodor [EMAIL PROTECTED] wrote:
  Dear Sir,
 
  I am new to Drools and I want to ask how can I implement the classical
  transitive closure in Drools. For instance we have a bunch of facts
  edge/2 and the transitive closure:
 
  reach(X,Y):- edge(X,Y).
  reach(X,Y):- edge(X,Z),reach(Z,Y).

 My current version looks like the following, but it never terminates.
 It re-derives reach(c,c) forever.

 TransitiveClosure.drl :
 package org.drools.examples

 import org.drools.examples.TransitiveClosureExample.Edge;
 import org.drools.examples.TransitiveClosureExample.Reach;

 rule reachDirect
salience 10
when
e : Edge(s1 : source, t1 : target)
not( Reach(source == s1, target == t1) )
then
insertLogical( new Reach(e.getSource(),e.getTarget()) );
System.out.println( Reach  + e.getSource() + , + e.getTarget()
 );
 end

 rule reachIndirect
salience 10
when
e : Edge(s1 : source, t1 : target)
r : Reach(t2 : target, source == t1 )
not( Reach(source == s1, target == t2) )
then
insertLogical( new Reach(e.getSource(),r.getTarget()) );
System.out.println( Reach  + e.getSource() + , + r.getTarget()
 );
 end

 TransitiveClosureExample.java :

 package org.drools.examples;
 import java.io.InputStreamReader;
 import org.drools.RuleBase;
 import org.drools.RuleBaseFactory;
 import org.drools.StatefulSession;
 import org.drools.audit.WorkingMemoryFileLogger;
 import org.drools.compiler.PackageBuilder;
 import org.drools.compiler.PackageBuilderConfiguration;

 public class TransitiveClosureExample {
public static void main(final String[] args) throws Exception {
PackageBuilderConfiguration conf = new
 PackageBuilderConfiguration();
final PackageBuilder builder = new PackageBuilder( conf );
builder.addPackageFromDrl( new InputStreamReader(
 TransitiveClosureExample.class.getResourceAsStream(
 TransitiveClosure.drl ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final StatefulSession session = ruleBase.newStatefulSession();
final WorkingMemoryFileLogger logger = new
 WorkingMemoryFileLogger( session );
logger.setFileName( log/transitiveClosure );

final Edge edgeAB = new Edge( a,b );
final Edge edgeBC = new Edge( b,c );
final Edge edgeCD = new Edge( c,d );

session.insert( edgeAB );
session.insert( edgeBC );
session.insert( edgeCD );

session.fireAllRules();
logger.writeToDisk();
session.dispose();
}

public static class Edge {
private String source;
private String target;
public Edge() {}
public Edge(String source, String target) {
super();
this.source = source;
this.target = target;
}
public String getSource() {
return source;
}
public String getTarget() {
return source;
}
}

public static class Reach {
private String source;
private String target;
public Reach() {}
public Reach(String source, String target) {
super();
this.source = source;
this.target = target;
}
public void setSource(String source) {
this.source = source;
}
public String getSource() {
return source;
}
public void setTarget(String target) {
this.target = target;
}
public String getTarget() {
return target;
}
}
 }

 Any sugestion?

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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  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