Re: [rules-users] Expert Systems and Functional programming?

2013-03-12 Thread Wolfgang Laun
Indeed, this thesis mentions a few features of the system I was
talking about :-)
([13])
-W

On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 There were a number of research efforts that looked at combining procedural
 and rule base programming.
 This one is quite interesting:
 Combining Rule-Based and Procedural Programming in the XC and XE Programming
 Lanaugages
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf

 Mark


 On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
 So thinking really long term here. Can we build a java layer that
 provide all the rule functionality we need - but fit ontop of the java
 language neatly. We'd probably need to allow rule keyword and have it in
 Classes, at the method level. All class members and methods would be
 available to the rules in that class.

 There is this production rule system where you can write your rules
 embedded in compiling units, and alongside the legacy program units, of a
 procedural, modular, strongly type HLL, and where you use expressions in
 the language's own syntax in constraints...

 We've been using it ever since 1986. Rabbi Akiva was right, wasn't he ;-)

 -W

 ___
 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] Drools 5.5 and jBPM 5.4 on Weblogic 10.3.4

2013-03-12 Thread abhishekbiyala
Hi,

I have been struggling to get drools 5.5 and jBPM 5.4 embedded in a weblogic
10.3.4 application. 
Seems like there is some conflict between drools and weblogic jars. But how
to resolve?

This is the exception I am getting -

java.lang.NoSuchMethodError:
org.drools.util.CompositeClassLoader.clone()Lorg/drools/util/CompositeClassLoader;
   at
org.drools.compiler.PackageBuilderConfiguration.getClassLoader(PackageBuilderConfiguration.java:362)
   at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:98)
   at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:61)
   at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:317)
   at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
   at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
   at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:170)
   at
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:22)
   at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:75)
   at
org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:80)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
   at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
   at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
   at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
   at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
   at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
   at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
   at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
   at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
   at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
   at
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
   at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
   at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
   at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
   at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
   at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
   at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
   at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
   at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
   at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
   at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
   at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
   at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
   at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
   at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
   at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
   at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
   at

[rules-users] Ignore subsequent conditions in a Decision Table based on previous condition

2013-03-12 Thread ciberg2
Hi, I'm new to Drools and I'm implementing rules using Excel decision tables
and I need some of your help.

I have some rules in which depending on a condition the following condition
is not necessary, how can I define a table that akllows to define this?

For instance I have:
CONDITION   CONDITION   CONDITION  ACTION
Y   

result1
NN Y
  
result2
NN N
  
result3
NY N
  
result4
NY Y
  
result5

In the example above (I hope you can see it right) if the first condition
value is Y the other 2 conditions values don't matter and despite their
value the result will always be the same.
I wouldn't want to have to write all the possible combinations as these in
the real case will add a lot of complexity to the tables.

How can I accomplish this? Is it possible to do it in Excel? If not, how can
I do it in another way (for instantance with guvnor web-based tables).



--
View this message in context: 
http://drools.46999.n3.nabble.com/Ignore-subsequent-conditions-in-a-Decision-Table-based-on-previous-condition-tp4022778.html
Sent from the Drools: User forum 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] Ignore subsequent conditions in a Decision Table based on previous condition

2013-03-12 Thread Michael Anstis
If a CONDITION (or ACTION for that matter) is not to apply for a given rule
you should be able to simply leave the cell empty.

CONDITION   CONDITION   CONDITION  ACTION
Y
result1
N   N   Y  result2
N   N   N  result3
N   Y   N  result4
N   Y   Y  result5


On 12 March 2013 10:03, ciberg2 joaoguerr...@gmail.com wrote:

 Hi, I'm new to Drools and I'm implementing rules using Excel decision
 tables
 and I need some of your help.

 I have some rules in which depending on a condition the following condition
 is not necessary, how can I define a table that akllows to define this?

 For instance I have:
 CONDITION   CONDITION   CONDITION  ACTION
 Y
 result1
 NN Y
 result2
 NN N
 result3
 NY N
 result4
 NY Y
 result5

 In the example above (I hope you can see it right) if the first condition
 value is Y the other 2 conditions values don't matter and despite their
 value the result will always be the same.
 I wouldn't want to have to write all the possible combinations as these in
 the real case will add a lot of complexity to the tables.

 How can I accomplish this? Is it possible to do it in Excel? If not, how
 can
 I do it in another way (for instantance with guvnor web-based tables).



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Ignore-subsequent-conditions-in-a-Decision-Table-based-on-previous-condition-tp4022778.html
 Sent from the Drools: User forum 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] Ignore subsequent conditions in a Decision Table based on previous condition

2013-03-12 Thread ciberg2
manstis, thank you for your fast reply!

I can't believe it was so simple and I couldn't find the answer :) (bangs
head against the wall).

I will do that then.

Thank you again.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Ignore-subsequent-conditions-in-a-Decision-Table-based-on-previous-condition-tp4022778p4022780.html
Sent from the Drools: User forum 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] Expert Systems and Functional programming?

2013-03-12 Thread Mark Proctor

On 12 Mar 2013, at 02:10, Grant Rettke gret...@acm.org wrote:

 On Mon, Mar 11, 2013 at 10:19 AM, Mark Proctor mproc...@codehaus.org wrote:
 For instance here is an idea I've been mulling over recently (note just 
 random ideas, not roadmap). We don't have
 the resources to completely compete against other languages, and I'm not 
 sure we should do. With Java8 and 9 it
 starts to become a more compelling language. Java8 brings lambs and java9 
 solve the perm gen issue (so we can
 stop using MVEL, and just go pure code generation and not worry about 
 blowing the perm gen).  Could we create a
 system that better layers with java9?
 
 Any other JVM languages that would serve you well right now?
Anyone that offers type safety. So Scala, Ceylon, Koitlin would all be 
contenders. Java is simply the lowest common denominator that reaches the 
widest possible mark.  But as mentioned, base java is not enough - we'd need to 
layer property accessors on it.

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


Re: [rules-users] Expert Systems and Functional programming?

2013-03-12 Thread Mark Proctor
OPS83?
http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478context=compsci


or YES/L1? (seems information on this is out of print and not online either)
http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
YES/L1: Integrating expert systems technology with traditional programming 
languages (Research Report RC. International Business Machines Inc. Research 
Division)


I definitely find linq interesting, as it's straight out of the research pages 
from these projects - I wonder if the linq/database propel know about these… 
The first time I saw it was in this paper procedural match augments 
data-driven match
http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf

They move the lhs logic into the consequence block, using the actual when 
part as a simple goal trigger - allowing the 'lhs' to be used procedurally, 
like linq. This allows them to control when a rule is evaluated and that it's 
evaluation is atomic, and can have cleanup work done.

Mark

On 12 Mar 2013, at 06:04, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Indeed, this thesis mentions a few features of the system I was
 talking about :-)
 ([13])
 -W
 
 On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 There were a number of research efforts that looked at combining procedural
 and rule base programming.
 This one is quite interesting:
 Combining Rule-Based and Procedural Programming in the XC and XE Programming
 Lanaugages
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf
 
 Mark
 
 
 On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
 So thinking really long term here. Can we build a java layer that
 provide all the rule functionality we need - but fit ontop of the java
 language neatly. We'd probably need to allow rule keyword and have it in
 Classes, at the method level. All class members and methods would be
 available to the rules in that class.
 
 There is this production rule system where you can write your rules
 embedded in compiling units, and alongside the legacy program units, of a
 procedural, modular, strongly type HLL, and where you use expressions in
 the language's own syntax in constraints...
 
 We've been using it ever since 1986. Rabbi Akiva was right, wasn't he ;-)
 
 -W
 
 ___
 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] Instant Drools Starter : Pack Publishing (Jeremy Ary)

2013-03-12 Thread Grant Rettke
On Tue, Mar 12, 2013 at 10:00 AM, Mark Proctor mproc...@codehaus.org wrote:
 http://blog.athico.com/2013/03/instant-drools-starter-pack-publishing.html

Nice! Just ordered it.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Expert Systems and Functional programming?

2013-03-12 Thread Wolfgang Laun
Mark,

no, the system I'm talking about is PAMELA, developed here in Vienna.
You may find references to papers citing PAMELA, authored by
F.Barachini and N.Theuretzbacher (one is referenced in the thesis you
quoted, see [13]), but I doubt that you'l find one of the papers on
the web. It was pre-internet days way back then :-)

If you could produce an RBS ranking based on rules fired in
production, I think that PAMELA would be in an excellent position.
There's a three-digit number of installations by now, but they're
running 24/7.

-W


On 12/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 OPS83?
 http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478context=compsci


 or YES/L1? (seems information on this is out of print and not online
 either)
 http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
 YES/L1: Integrating expert systems technology with traditional programming
 languages (Research Report RC. International Business Machines Inc. Research
 Division)


 I definitely find linq interesting, as it's straight out of the research
 pages from these projects - I wonder if the linq/database propel know about
 these… The first time I saw it was in this paper procedural match augments
 data-driven match
 http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf

 They move the lhs logic into the consequence block, using the actual
 when part as a simple goal trigger - allowing the 'lhs' to be used
 procedurally, like linq. This allows them to control when a rule is
 evaluated and that it's evaluation is atomic, and can have cleanup work
 done.

 Mark

 On 12 Mar 2013, at 06:04, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Indeed, this thesis mentions a few features of the system I was
 talking about :-)
 ([13])
 -W

 On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 There were a number of research efforts that looked at combining
 procedural
 and rule base programming.
 This one is quite interesting:
 Combining Rule-Based and Procedural Programming in the XC and XE
 Programming
 Lanaugages
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf

 Mark


 On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
 So thinking really long term here. Can we build a java layer that
 provide all the rule functionality we need - but fit ontop of the java
 language neatly. We'd probably need to allow rule keyword and have it
 in
 Classes, at the method level. All class members and methods would be
 available to the rules in that class.

 There is this production rule system where you can write your rules
 embedded in compiling units, and alongside the legacy program units, of
 a
 procedural, modular, strongly type HLL, and where you use expressions
 in
 the language's own syntax in constraints...

 We've been using it ever since 1986. Rabbi Akiva was right, wasn't he
 ;-)

 -W

 ___
 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


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


Re: [rules-users] Implementing Refraction with Drools

2013-03-12 Thread Jim Hahn
Mark Proctor mproctor at codehaus.org writes:

 
 You can improve your example by using an agenda listener to remove 
Activations once they are cancelled,
 this way you avoid a memory leak.
 
 Further you can use annotations, to control this per rule.
 rule xxx @repeatable(true) when
 then end
 
 then in your filter you can check rule.getMetaData( repeatable )
 
 We aren't going to add this to Drools right now, but it certainly is a 
useful example for people. 
 
 We'll be reviewing execution control during the 6.x series, and we'll look 
at it then. I believe that you can
 have different types of repeability, and I'd like to look at rising falling 
edges. It's important that you
 don't add features one at a time, as one might make another impossible.  So 
these things must be look at, as a
 whole, and planned out.
 
 Mark
 On 23 Jan 2013, at 00:39, magaram magaram at deltadentalmi.com wrote:
 
  Thanks for the clarifications Mark and Wolfgang. I wanted to share some
  additional data.
  I was trying to reproduce the same behavior that ILOG JRules exhibits by
  default for refraction.
  
  My experiment with no-loop and lock-on-active did not work when I compared
  against my baseline results with JRules. However, the interesting part was
  when I ratified the agenda filter as follows (wrong and hacky as it is) -
  removed the encounteredActivations.remove(act) before returning false, it
  matched the ILOG baselines exactly. I ran through 46 test cases as part of
  my baseline, all of which have several looping opportunities single and
  complex. My earlier agenda filter implementation that I posted earlier did
  not yield identical results with the JRules baseline.
  
  It seems this logic for refraction seems to mimic JRules refraction
  behavior.  From commercial use case perspective refraction/repeatability
  control is important. ILOG implements refraction out of the box as part of
  conflict resolution. However they offer up a antecedent directive called
  refresh (in lieu of update) that overrides refraction...
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.drools.runtime.rule.Activation;
  import org.drools.runtime.rule.AgendaFilter;
  
  /**
  * This custom agenda filter injects refraction behavior into the rule
  engine
  * @author Mukundan Agaram
  *
  */
  public class RefractionAgendaFilter implements AgendaFilter {
  private ListActivation encounteredActivations = new
  ArrayListActivation();
  
  @Override
  public boolean accept(Activation act) 
  {
  //Check for a Refraction
  if (encounteredActivations.contains(act))
  {
  return false;
  }
  //Otherwise add the rule to check for potential refractions in 
the future
  encounteredActivations.add(act);
  //select the rule to be part of the agenda
  return true;
  }
  
  }
  
  
  
  
  --
  View this message in context: 
http://drools.46999.n3.nabble.com/Implementing-Refraction-with-Drools-
tp4021705p4021747.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 ___
 rules-users mailing list
 rules-users at lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 


Using an activation listener could help to eliminate the memory leak, but with 
the current implementation, it does not.  When activations are added and 
removed from the agenda, events are generated properly, in general.  However, 
there is one case that fails.  If an activation is actually fired, then it 
remains on the agenda and, because it was previously fired, if it is later 
removed from the agenda, no activation event is fired.  Unfortunately, this 
missing event is precisely the event that is needed to clean out your cache of 
previously-fired activations.  (This hole existed in Drools 4 and also in 
Drools 5 when I checked a few months ago.  Perhaps it has been fixed since 
then.)

If that hole were plugged, then this strategy would certainly do the job.  
Neverhteless, based on other comments in this thread, I'm not sure if there 
isn't a performance concern, though what other option is there until 
@repeatable (or some alternative) is implemented?

-Jim


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


[rules-users] [REQUEST] upgrade next version of drools to use the newer Janino library.

2013-03-12 Thread Felix
I am using the cascading 2.1 which bundles a newer version of the janino
2.6.1.  I'd like to see the next version of drools updated with the newer
janino.



--
View this message in context: 
http://drools.46999.n3.nabble.com/REQUEST-upgrade-next-version-of-drools-to-use-the-newer-Janino-library-tp4022788.html
Sent from the Drools: User forum 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] Implementing Refraction with Drools

2013-03-12 Thread Mark Proctor
The even is there, just it's an internal feature at the moment. 

There is an unmatch callback, for when a rule stops being true, see 
testActivationUnMatchListener:
https://github.com/droolsjbpm/drools/blob/master/drools-core/src/test/java/org/drools/reteoo/AgendaTest.java

What you can do is set a call back during the activation created event. You'll 
need to cast to an internal concrete class first, AgendaItem. Remember these 
interfaces and classes will change over time.

Mark


On 12 Mar 2013, at 18:53, Jim Hahn j...@att.com wrote:

 Mark Proctor mproctor at codehaus.org writes:
 
 
 You can improve your example by using an agenda listener to remove 
 Activations once they are cancelled,
 this way you avoid a memory leak.
 
 Further you can use annotations, to control this per rule.
 rule xxx @repeatable(true) when
 then end
 
 then in your filter you can check rule.getMetaData( repeatable )
 
 We aren't going to add this to Drools right now, but it certainly is a 
 useful example for people. 
 
 We'll be reviewing execution control during the 6.x series, and we'll look 
 at it then. I believe that you can
 have different types of repeability, and I'd like to look at rising falling 
 edges. It's important that you
 don't add features one at a time, as one might make another impossible.  So 
 these things must be look at, as a
 whole, and planned out.
 
 Mark
 On 23 Jan 2013, at 00:39, magaram magaram at deltadentalmi.com wrote:
 
 Thanks for the clarifications Mark and Wolfgang. I wanted to share some
 additional data.
 I was trying to reproduce the same behavior that ILOG JRules exhibits by
 default for refraction.
 
 My experiment with no-loop and lock-on-active did not work when I compared
 against my baseline results with JRules. However, the interesting part was
 when I ratified the agenda filter as follows (wrong and hacky as it is) -
 removed the encounteredActivations.remove(act) before returning false, it
 matched the ILOG baselines exactly. I ran through 46 test cases as part of
 my baseline, all of which have several looping opportunities single and
 complex. My earlier agenda filter implementation that I posted earlier did
 not yield identical results with the JRules baseline.
 
 It seems this logic for refraction seems to mimic JRules refraction
 behavior.  From commercial use case perspective refraction/repeatability
 control is important. ILOG implements refraction out of the box as part of
 conflict resolution. However they offer up a antecedent directive called
 refresh (in lieu of update) that overrides refraction...
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.drools.runtime.rule.Activation;
 import org.drools.runtime.rule.AgendaFilter;
 
 /**
 * This custom agenda filter injects refraction behavior into the rule
 engine
 * @author Mukundan Agaram
 *
 */
 public class RefractionAgendaFilter implements AgendaFilter {
 private ListActivation encounteredActivations = new
 ArrayListActivation();
 
 @Override
 public boolean accept(Activation act) 
 {
 //Check for a Refraction
 if (encounteredActivations.contains(act))
 {
 return false;
 }
 //Otherwise add the rule to check for potential refractions in 
 the future
 encounteredActivations.add(act);
 //select the rule to be part of the agenda
 return true;
 }
 
 }
 
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Implementing-Refraction-with-Drools-
 tp4021705p4021747.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users at lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 ___
 rules-users mailing list
 rules-users at lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
 Using an activation listener could help to eliminate the memory leak, but 
 with 
 the current implementation, it does not.  When activations are added and 
 removed from the agenda, events are generated properly, in general.  However, 
 there is one case that fails.  If an activation is actually fired, then it 
 remains on the agenda and, because it was previously fired, if it is later 
 removed from the agenda, no activation event is fired.  Unfortunately, this 
 missing event is precisely the event that is needed to clean out your cache 
 of 
 previously-fired activations.  (This hole existed in Drools 4 and also in 
 Drools 5 when I checked a few months ago.  Perhaps it has been fixed since 
 then.)
 
 If that hole were plugged, then this strategy would certainly do the job.  
 Neverhteless, based on other comments in this thread, I'm not sure if there 
 isn't a performance concern, though what other option is there until 
 @repeatable (or some alternative) is implemented?
 
 -Jim
 
 

Re: [rules-users] [REQUEST] upgrade next version of drools to use the newer Janino library.

2013-03-12 Thread Mark Proctor
Have you tried just using the 2.6.1 janino jar? It may just work.

Mark
On 12 Mar 2013, at 19:06, Felix fe...@bluekai.com wrote:

 I am using the cascading 2.1 which bundles a newer version of the janino
 2.6.1.  I'd like to see the next version of drools updated with the newer
 janino.
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/REQUEST-upgrade-next-version-of-drools-to-use-the-newer-Janino-library-tp4022788.html
 Sent from the Drools: User forum 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] [REQUEST] upgrade next version of drools to use the newer Janino library.

2013-03-12 Thread Felix Gao
I tried. It throws lang.NoClassDefFoundError:
org/codehaus/janino/CompileException because the class file moved to a
different jar file and package location.

On Tue, Mar 12, 2013 at 12:18 PM, Mark Proctor mproc...@codehaus.orgwrote:

 Have you tried just using the 2.6.1 janino jar? It may just work.

 Mark
 On 12 Mar 2013, at 19:06, Felix fe...@bluekai.com wrote:

  I am using the cascading 2.1 which bundles a newer version of the janino
  2.6.1.  I'd like to see the next version of drools updated with the newer
  janino.
 
 
 
  --
  View this message in context:
 http://drools.46999.n3.nabble.com/REQUEST-upgrade-next-version-of-drools-to-use-the-newer-Janino-library-tp4022788.html
  Sent from the Drools: User forum 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

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

[rules-users] configuring timings for event expiry

2013-03-12 Thread rule_dev
Hi ,

I was wondering if it is possible to write a rule in such a way that you are
able to set the 'this after' for events using an attribute from a class.

rule correlate orders
when
$bo : BuyOrderEvent( $id : id ) 
$ae : AckEvent( id == $id, this after[0,10s] $bo )
then
// do something
end

in the above rule template I would like to set the this after [0,10] part
using a custom value from say a date attribute of the BuyOrderEvent class.

Thanks for your time.



--
View this message in context: 
http://drools.46999.n3.nabble.com/configuring-timings-for-event-expiry-tp4022792.html
Sent from the Drools: User forum 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] Confused by Simple Self-Loop Problem

2013-03-12 Thread droolist
You are most likely going into an infinite loop. Drools happened to pick that
activation first every time and never came out of the loop. If you see the
audit view below, notice that there are 3 activations and only 1 keeps
firing an is in a loop and the other 2 didnt get a chance to fire. But,
there are activations.

http://drools.46999.n3.nabble.com/file/n4022793/audit.jpg 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Confused-by-Simple-Self-Loop-Problem-tp4022774p4022793.html
Sent from the Drools: User forum 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] Implementing Refraction with Drools

2013-03-12 Thread jrh3
I just downloaded the last Drools 5.5 source code and it still has the
problem.  In DefaultAgenda.java, at line 707 in the cancelActivation()
method, it calls decreaseDormantActivations(), but doesn't bother to fire an
ActivationCancelled event.  If lines 701-703 are copied before line 707,
then that is a quick way to fix the problem.  (I have not checked 6.0)

-Jim



--
View this message in context: 
http://drools.46999.n3.nabble.com/Implementing-Refraction-with-Drools-tp4021705p4022794.html
Sent from the Drools: User forum 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] Implementing Refraction with Drools

2013-03-12 Thread Mark Proctor
The code looks ok to me.  If an activation has fired, then you cannot cancel 
it. Cancelled events are only for activations that are true and have not yet 
fired.

Read my previous email about how to use the unmatch listener, that will do what 
you want.

Mark
On 12 Mar 2013, at 20:49, jrh3 j...@att.com wrote:

 I just downloaded the last Drools 5.5 source code and it still has the
 problem.  In DefaultAgenda.java, at line 707 in the cancelActivation()
 method, it calls decreaseDormantActivations(), but doesn't bother to fire an
 ActivationCancelled event.  If lines 701-703 are copied before line 707,
 then that is a quick way to fix the problem.  (I have not checked 6.0)
 
 -Jim
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Implementing-Refraction-with-Drools-tp4021705p4022794.html
 Sent from the Drools: User forum 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] Expert Systems and Functional programming?

2013-03-12 Thread Mark Proctor
Actually Pamela is one of the papers I've been trying to track down, can't get 
it on the internet any more. As I first saw it referenced in Production 
matching for large learning systems.

You don't by chance have the paper still?
Barachini, F. (1991) The evolution of PAMELA. Expert Systems, 8(2):87-98

I'm building up a collection of relevant research papers, over at mendelay. 
That is one of my missing papers, that I've been unable to track:
http://www.mendeley.com/groups/2918061/rule-systems/papers/

Mark
On 12 Mar 2013, at 18:28, Wolfgang Laun wolfgang.l...@gmail.com wrote:

 Mark,
 
 no, the system I'm talking about is PAMELA, developed here in Vienna.
 You may find references to papers citing PAMELA, authored by
 F.Barachini and N.Theuretzbacher (one is referenced in the thesis you
 quoted, see [13]), but I doubt that you'l find one of the papers on
 the web. It was pre-internet days way back then :-)
 
 If you could produce an RBS ranking based on rules fired in
 production, I think that PAMELA would be in an excellent position.
 There's a three-digit number of installations by now, but they're
 running 24/7.
 
 -W
 
 
 On 12/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 OPS83?
 http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478context=compsci
 
 
 or YES/L1? (seems information on this is out of print and not online
 either)
 http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
 YES/L1: Integrating expert systems technology with traditional programming
 languages (Research Report RC. International Business Machines Inc. Research
 Division)
 
 
 I definitely find linq interesting, as it's straight out of the research
 pages from these projects - I wonder if the linq/database propel know about
 these… The first time I saw it was in this paper procedural match augments
 data-driven match
 http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf
 
 They move the lhs logic into the consequence block, using the actual
 when part as a simple goal trigger - allowing the 'lhs' to be used
 procedurally, like linq. This allows them to control when a rule is
 evaluated and that it's evaluation is atomic, and can have cleanup work
 done.
 
 Mark
 
 On 12 Mar 2013, at 06:04, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 Indeed, this thesis mentions a few features of the system I was
 talking about :-)
 ([13])
 -W
 
 On 11/03/2013, Mark Proctor mproc...@codehaus.org wrote:
 There were a number of research efforts that looked at combining
 procedural
 and rule base programming.
 This one is quite interesting:
 Combining Rule-Based and Procedural Programming in the XC and XE
 Programming
 Lanaugages
 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106rep=rep1type=pdf
 
 Mark
 
 
 On 11 Mar 2013, at 18:03, Wolfgang Laun wolfgang.l...@gmail.com wrote:
 
 On 11 March 2013 16:19, Mark Proctor mproc...@codehaus.org wrote:
 So thinking really long term here. Can we build a java layer that
 provide all the rule functionality we need - but fit ontop of the java
 language neatly. We'd probably need to allow rule keyword and have it
 in
 Classes, at the method level. All class members and methods would be
 available to the rules in that class.
 
 There is this production rule system where you can write your rules
 embedded in compiling units, and alongside the legacy program units, of
 a
 procedural, modular, strongly type HLL, and where you use expressions
 in
 the language's own syntax in constraints...
 
 We've been using it ever since 1986. Rabbi Akiva was right, wasn't he
 ;-)
 
 -W
 
 ___
 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
 
 
 ___
 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