Re: [rules-users] Unsatisfied rule fires - Drools bug?

2011-09-27 Thread Wolfgang Laun
Please use the new knowledge API for compiling and building a knowledge
(not: rule) base.

This bug has been fixed for 5.3.0. It is one of several that may occur when
you use 5.2.0 and deviate from the constraint syntax as defined with 5.1.1.

-W


On 26 September 2011 22:51, matvey1414 matvey1...@gmail.com wrote:

 Hi,

 I am working with Drools to implement a high-profile rules-engine. I have
 two rules defined. Clearly, only the first should fire, but both do. Here
 is
 my DRL:


 package com.sample

 import com.sample.DroolsTest.Request;

 rule ExpensiveCanonShopper0
 when
Request( attributeMap[camera0] == canon 
 attributeMap[price0] = 500 )
 then
System.out.println(ExpensiveCanonShopper0);
 end

 rule ExpensiveCanonShopper1
 when
Request( attributeMap[camera1] == canon 
 attributeMap[price1] = 500 )
 then
System.out.println(ExpensiveCanonShopper1);
 end

 And the Java class to execute it:

 public class DroolsTest {

@SuppressWarnings({ rawtypes, unchecked })
public static final void main(String[] args) {
try {
//Loading the Rules
System.out.println(Loading rules);
RuleBase ruleBase = readRule();
StatelessSession workingMemory =
 ruleBase.newStatelessSession();

System.out.println(Firing rules);

Map map = new HashMap();
map.put(camera0, canon);
map.put(price0, 600);

Request request = new Request();
request.setAttributeMap(map);
workingMemory.execute(request);

} catch (Throwable t) {
t.printStackTrace();
}
}

/**
 * Please note that this is the “low level” rule assembly API.
 */
private static RuleBase readRule() throws Exception {
//read in the source
Reader source = new FileReader(new File(drl,
 Generated.drl));

//optionally read in the DSL (if you are using it).
//Reader dsl = new InputStreamReader(
 DroolsTest.class.getResourceAsStream( “/mylang.dsl” ) );

//Use package builder to build up a rule package.
//An alternative lower level class called “DrlParser” can
 also be used…

PackageBuilder builder = new PackageBuilder();

//this wil parse and compile in one step
//NOTE: There are 2 methods here, the one argument one is
 for normal DRL.
builder.addPackageFromDrl( source );
if (builder.hasErrors()) {
PackageBuilderErrors errors = builder.getErrors();
throw new RuntimeException(Error adding package to
 builder:  + errors.toString());
}

//Use the following instead of above if you are using a DSL:
//builder.addPackageFromDrl( source, dsl );

//get the compiled package (which is serializable)
Package pkg = builder.getPackage();

//add the package to a rulebase (deploy the rule package).
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );
return ruleBase;
}

public static class Request {
private Map attributeMap;

public Map getAttributeMap() {
return attributeMap;
}

public void setAttributeMap(Map attributeMap) {
this.attributeMap = attributeMap;
}
}
 }

 The output is this, meaning both rules fired:
 Loading rules
 Firing rules
 ExpensiveCanonShopper1
 ExpensiveCanonShopper0

 I have two questions:

 1. Is this a bug, or am I doing something wrong? Only
 ExpensiveCanonShopper0 should fire.

 2. I am pretty sure this is somehow related to the fact that I'm using Map
 attributes, and not POJO to get price0 and camera0. My issue is that I
 won't know the parameters in advance (they are coming in a URL), so I can't
 pre-declare them, and thus need something dynamic like a Map. Is this how
 Drools is intended to be used? The documentation appears very POJO-centric.

 I am using Drools 5.2

 Thank you!
 -Matt

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Unsatisfied-rule-fires-Drools-bug-tp3370653p3370653.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Hari Kishan
Please find attached the rule Code (.drl) below.

Frequently getting this below Exception while running rules. 

Exception caught while executing action:
org.drools.reteoo.PropagationQueuingNode$PropagateAction@41c317

java.lang.NullPointerException

  at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:106)

  at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:11)

  at org.drools.reteoo.CollectNode.assertObject(CollectNode.java:256)

  at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

  at
org.drools.reteoo.RightInputAdapterNode.assertLeftTuple(RightInputAdapterNode.java:135)

  at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)

  at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)

  at org.drools.reteoo.FromNode.evaluateAndPropagate(FromNode.java:156)

  at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:104)

  at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)

  at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:39)

  at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:175)

  at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

  at
org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)

  at
org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)

  at
org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)

  at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)

  at org.mule.module.drools.Drools.assertEvent(Drools.java:165)

  at org.mule.module.bpm.Rules.handleEvent(Rules.java:131)

  at org.mule.module.bpm.RulesComponent.doInvoke(RulesComponent.java:84)

  at
org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)

  at
org.mule.component.AbstractComponent.access$000(AbstractComponent.java:56)

  at
org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:234)

  at
org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)

  at
org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)

  at
org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)

  at
org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)

  at
org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)

  at
org.mule.component.AbstractComponent.process(AbstractComponent.java:154)

  at
org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:93)

  at
org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)

  at
org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:118)

  at
org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doWork(SedaStageInterceptingMessageProcessor.java:197)

  at
org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doRun(SedaStageInterceptingMessageProcessor.java:178)

  at
org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)

  at org.mule.work.WorkerContext.run(WorkerContext.java:309)

  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

  at java.lang.Thread.run(Thread.java:619)

http://drools.46999.n3.nabble.com/file/n3372189/sensors.drl sensors.drl 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372189.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Wolfgang Laun
Drools version?

Looks like a bug, I've seen similar NPE reports.

-W

On 27 September 2011 12:23, Hari Kishan 
harikishan.tamm...@pass-consulting.com wrote:

 Please find attached the rule Code (.drl) below.

 Frequently getting this below Exception while running rules.

 Exception caught while executing action:
 org.drools.reteoo.PropagationQueuingNode$PropagateAction@41c317

 java.lang.NullPointerException

  at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:106)

  at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:11)

  at org.drools.reteoo.CollectNode.assertObject(CollectNode.java:256)

  at

 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

  at

 org.drools.reteoo.RightInputAdapterNode.assertLeftTuple(RightInputAdapterNode.java:135)

  at

 org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)

  at

 org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)

  at org.drools.reteoo.FromNode.evaluateAndPropagate(FromNode.java:156)

  at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:104)

  at

 org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)

  at

 org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:39)

  at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:175)

  at

 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

  at

 org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)

  at

 org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)

  at

 org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)

  at

 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)

  at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)

  at org.mule.module.drools.Drools.assertEvent(Drools.java:165)

  at org.mule.module.bpm.Rules.handleEvent(Rules.java:131)

  at org.mule.module.bpm.RulesComponent.doInvoke(RulesComponent.java:84)

  at

 org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:120)

  at
 org.mule.component.AbstractComponent.access$000(AbstractComponent.java:56)

  at

 org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:234)

  at

 org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:88)

  at

 org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)

  at

 org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:63)

  at

 org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:89)

  at

 org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:94)

  at
 org.mule.component.AbstractComponent.process(AbstractComponent.java:154)

  at

 org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:93)

  at

 org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)

  at

 org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:118)

  at

 org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doWork(SedaStageInterceptingMessageProcessor.java:197)

  at

 org.mule.processor.SedaStageInterceptingMessageProcessor$SedaStageWorker.doRun(SedaStageInterceptingMessageProcessor.java:178)

  at
 org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)

  at org.mule.work.WorkerContext.run(WorkerContext.java:309)

  at

 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

  at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

  at java.lang.Thread.run(Thread.java:619)

 http://drools.46999.n3.nabble.com/file/n3372189/sensors.drl sensors.drl

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372189.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 

Re: [rules-users] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread S_Kumar_P
I also was getting this error. I brought out package building logic to execute 
once, and KnowledgeSession realted logic to repeat the required number of times.

Seems there required some delay in preparing rules related classes into one 
package during iteration. Above step was working fine for me.

Pseudo code:

  KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

  // this will parse and compile in one step

  // get the compiled packages (which are serializable)
  CollectionKnowledgePackage pkgs = null;

  // add the packages to a knowledgebase (deploy the knowledge packages).
  KnowledgeBase kbase = null;

  StatefulKnowledgeSession ksession = null;
  // constructor to be called once
public RuleEngine (byte[] rules) {

kbuilder.add(ResourceFactory.newByteArrayResource(rules),ResourceType.DRL);
//  Check the builder for errors
if (kbuilder.hasErrors()) {
  System.out.println(kbuilder.getErrors().toString());
  throw new RuntimeException(Unable to compile drl.);
}
pkgs = kbuilder.getKnowledgePackages();

// add the packages to a knowledgebase (deploy the knowledge 
packages).
kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
  }

// this method will be called required number of times
  public void fire(Object obj) {

ksession = kbase.newStatefulKnowledgeSession();
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());

// setup the audit logging
//KnowledgeRuntimeLogger logger = 
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, log/drools.log);

ksession.insert(obj);

ksession.fireAllRules();

//logger.close();

ksession.dispose();
  }


Check this out.

Thanks  Regards
Santhosh
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Tuesday, September 27, 2011 4:10 PM
To: Rules Users List
Subject: Re: [rules-users] Getting Exception while running rules continuously 
on the Event Streams from Mule Component.

Drools version?

Looks like a bug, I've seen similar NPE reports.

-W
On 27 September 2011 12:23, Hari Kishan 
harikishan.tamm...@pass-consulting.commailto:harikishan.tamm...@pass-consulting.com
 wrote:
Please find attached the rule Code (.drl) below.

Frequently getting this below Exception while running rules.

Exception caught while executing action:
org.drools.reteoo.PropagationQueuingNode$PropagateAction@41c317mailto:org.drools.reteoo.PropagationQueuingNode$PropagateAction@41c317

java.lang.NullPointerException

 at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:106)

 at org.drools.util.LeftTupleList.toArray(LeftTupleList.java:11)

 at org.drools.reteoo.CollectNode.assertObject(CollectNode.java:256)

 at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

 at
org.drools.reteoo.RightInputAdapterNode.assertLeftTuple(RightInputAdapterNode.java:135)

 at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)

 at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)

 at org.drools.reteoo.FromNode.evaluateAndPropagate(FromNode.java:156)

 at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:104)

 at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145)

 at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:39)

 at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:175)

 at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)

 at
org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)

 at
org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)

 at
org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)

 at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)

 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)

 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)

 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)

 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)

 at org.mule.module.drools.Drools.assertEvent(Drools.java:165)

 at org.mule.module.bpm.Rules.handleEvent(Rules.java:131)

 at org.mule.module.bpm.RulesComponent.doInvoke(RulesComponent.java:84)

 at

Re: [rules-users] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Hari Kishan
*Drools Version : 5.0.1 *

*The Drools API used in Mule *:

drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar

--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372442.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Swindells, Thomas
It may be worth you trying a later version of drools to see whether the issue 
still exists - there have been quite a few bug fixes since then!

In theory it shouldn't be too much work to change - check the release notes for 
maven group/project id changes, but there are some subtle differences in some 
of the rule syntax validation in places which may or may not make it painful.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of Hari Kishan
 Sent: 27 September 2011 13:33
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] Getting Exception while running rules continuously
 on the Event Streams from Mule Component.

 *Drools Version : 5.0.1 *

 *The Drools API used in Mule *:

 drools-api-5.0.1.jar
 drools-compiler-5.0.1.jar
 drools-core-5.0.1.jar

 --
 View this message in context: http://drools.46999.n3.nabble.com/Getting-
 Exception-while-running-rules-continuously-on-the-Event-Streams-from-
 Mule-Component-tp3372189p3372442.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


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


[rules-users] Partial Unification / Derivation of Facts?

2011-09-27 Thread JohnnyCaimbridge
NOTE: Reposted because I only just subscribed to the mailing list.

Hello, 

I have a set of Fact types which represent factors matched and used
throughout the other rules.  Each of these Fact types may be derived in a
variety of mutually exclusive ways--ie based on the line of business or
other factors.  The rules are all well-defined for these Facts.  Something
like this: 

declare FactorType1 
   value : BigDecimal 
end 

rule FactorType1 
when 
   LineOfBusiness( this == LineOfBusiness.LOB1 ) 
   // some other conditions 
   $prms : Params() // ***provisional*** where to specify needed context
dependent parameters? see below 
then 
   BigDecimal value = new BigDecimal(0); 
   // ... determine value based on conditions and $prms 
   insert( new FactorType1(value) ); 
end 

// some other mutually exclusive rules to derive FactorType1 here

The problem is that in the rules which match these Facts, there are many
context dependent (ie *always* unique to that particular rule) parameters
which must be passed to the derivation of those Facts.  I'm referring to
these as Params above.  Now, a rule that uses FactorType1: 

rule a rule that uses FactorType1 
when 
   // some conditions 
   FactorType1( $value ) 
   $prms : Params(prm1,prm2,prm3,...) // ***provisional*** how to indicate
that FactorType1 should use these parameters in its derivation? 
then 
   // perform some calculation with $value 
end 

The parameters which these Facts use cannot be asserted as Facts themselves. 
They are unique to the rules which match on the FactorTypes, so that would
mean I'd need a duplicate rule for every rule that uses a FactorType (even
with rule inheritance, this is excessive). 

It's almost as if I need to specify a partial derivation or partial
unification of the Fact type, which is only asserted once a rule indicates
that it is providing the unbound portion of the derivation.  I understand
queries can be used for some sort of partial unification, but I have no clue
how to apply them to my problem and I can't find any good examples or
documentation on their usage/behavior. 

Thanks in advance  



--
View this message in context: 
http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372546.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] Not able to call parameterizied Java method in LHS

2011-09-27 Thread Tinku
I tried to invoke parameterizied call to the java method and tried to compare
the return parameter from the method in the 'eval' function..The rule is not
getting executed ..

I am not sure if it is unable to invoke the java method and fetch the return
parameter or there is an issue with rule syntax..

Please help me in this regard.

LHS of the rule :
**
import com.customObject

rule A

when
$B : customObject()

eval($B.getValue(Database).equals(ORACLE))

then

System.out.println(The database object is oracle)

end

--
View this message in context: 
http://drools.46999.n3.nabble.com/Not-able-to-call-parameterizied-Java-method-in-LHS-tp3372552p3372552.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] Partial Unification / Derivation of Facts?

2011-09-27 Thread Swindells, Thomas

 It's almost as if I need to specify a partial derivation or partial 
 unification
 of the Fact type, which is only asserted once a rule indicates that it is
 providing the unbound portion of the derivation.  I understand queries can
 be used for some sort of partial unification, but I have no clue how to apply
 them to my problem and I can't find any good examples or documentation
 on their usage/behavior.

I don't fully understand what you are trying to achieve, but I think what you 
are asking for is the Trait support that has just been introduced in the latest 
release?
Have a look at the latest release notes and see if that helps you.
Thomas


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


Re: [rules-users] Partial Unification / Derivation of Facts?

2011-09-27 Thread Wolfgang Laun
This uses several terms I'm not familiar with in this context, but it seems
that

   1. a ule uniquely determines a Class to be instantiated on its RHS
   2. a set of parameters is required that, in turn, depends on the Class
   determined according to (1).

I do not understand why these parameters cannot be inserted as facts.

Each parameter set (!) would be a fact with one field containing the Class,
and this could be matched in the rule, passing parameters to the processing
to be done in the same rule.

  $p: Params( clazz == (FactorType1.class), $pSet: paramSet )

-W


On 27 September 2011 15:11, JohnnyCaimbridge nbo...@nycm.com wrote:

 NOTE: Reposted because I only just subscribed to the mailing list.

 Hello,

 I have a set of Fact types which represent factors matched and used
 throughout the other rules.  Each of these Fact types may be derived in a
 variety of mutually exclusive ways--ie based on the line of business or
 other factors.  The rules are all well-defined for these Facts.  Something
 like this:

 declare FactorType1
   value : BigDecimal
 end

 rule FactorType1
 when
   LineOfBusiness( this == LineOfBusiness.LOB1 )
   // some other conditions
   $prms : Params() // ***provisional*** where to specify needed context
 dependent parameters? see below
 then
   BigDecimal value = new BigDecimal(0);
   // ... determine value based on conditions and $prms
   insert( new FactorType1(value) );
 end

 // some other mutually exclusive rules to derive FactorType1 here

 The problem is that in the rules which match these Facts, there are many
 context dependent (ie *always* unique to that particular rule) parameters
 which must be passed to the derivation of those Facts.  I'm referring to
 these as Params above.  Now, a rule that uses FactorType1:

 rule a rule that uses FactorType1
 when
   // some conditions
   FactorType1( $value )
   $prms : Params(prm1,prm2,prm3,...) // ***provisional*** how to indicate
 that FactorType1 should use these parameters in its derivation?
 then
   // perform some calculation with $value
 end

 The parameters which these Facts use cannot be asserted as Facts
 themselves.
 They are unique to the rules which match on the FactorTypes, so that would
 mean I'd need a duplicate rule for every rule that uses a FactorType (even
 with rule inheritance, this is excessive).

 It's almost as if I need to specify a partial derivation or partial
 unification of the Fact type, which is only asserted once a rule indicates
 that it is providing the unbound portion of the derivation.  I understand
 queries can be used for some sort of partial unification, but I have no
 clue
 how to apply them to my problem and I can't find any good examples or
 documentation on their usage/behavior.

 Thanks in advance



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372546.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] Not able to call parameterizied Java method in LHS

2011-09-27 Thread Wolfgang Laun
What do you get when you omit the eval and print the return value of
$B.getValue(Database)?
-W

On 27 September 2011 15:14, Tinku dibya@gmail.com wrote:

 I tried to invoke parameterizied call to the java method and tried to
 compare
 the return parameter from the method in the 'eval' function..The rule is
 not
 getting executed ..

 I am not sure if it is unable to invoke the java method and fetch the
 return
 parameter or there is an issue with rule syntax..

 Please help me in this regard.

 LHS of the rule :
 **
 import com.customObject

 rule A

 when
 $B : customObject()

 eval($B.getValue(Database).equals(ORACLE))

 then

 System.out.println(The database object is oracle)

 end

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Not-able-to-call-parameterizied-Java-method-in-LHS-tp3372552p3372552.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Hari Kishan
@Thomas,

Those Drools library is part of the Mule ESB 3.2.0 I think it would be very
risky to change the libraries.
As there might be some version dependencies (Compatibility issues).

If you have any other idea of how to fix it 

In the mean while I will checking by replacing the drools library and check
it.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372668.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] java.lang.IncompatibleClassChangeError: Found interface org.drools.reteoo.LeftTuple, but class was expected

2011-09-27 Thread danielje
I finally found the root cause. The reason was incompatibility between model
classes uploaded to guvnor and classes referenced by client application (The
model classes in client app implement additionally Serializable interface
required by JPAKnowledgeSession).

So the root cause was slightly different than what I found in logs. 

I'm wondering if this is possible to make the error more accurate in such
situation. Is it drools or java who throws this exception?

/danielje

--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-IncompatibleClassChangeError-Found-interface-org-drools-reteoo-LeftTuple-but-class-was-expd-tp3358026p3372680.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] Not able to call parameterizied Java method in LHS

2011-09-27 Thread Tinku
There was an issue within the class that was used to insert the facts..Hence
the value was not inserted properly..

The result of the printing the value is now as 'ORACLE'..

Thanks.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Not-able-to-call-parameterizied-Java-method-in-LHS-tp3372552p3372683.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread HariKishan
Hi Thomas,

Those Drools library is part of the Mule ESB 3.2.0
I think it would be very risky to change the libraries.
As there might be some version dependencies (Compatibility issues).

If you have any other idea of how to fix it 

In the mean while I will checking by replacing the drools library and check
it.

Thanks  Regards,
Hari Kishan T


-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Thomas
Sent: Tuesday, September 27, 2011 6:40 PM
To: Rules Users List
Subject: Re: [rules-users] Getting Exception while running rules
continuously on the Event Streams from Mule Component.

It may be worth you trying a later version of drools to see whether the
issue still exists - there have been quite a few bug fixes since then!

In theory it shouldn't be too much work to change - check the release notes
for maven group/project id changes, but there are some subtle differences in
some of the rule syntax validation in places which may or may not make it
painful.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of Hari Kishan
 Sent: 27 September 2011 13:33
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] Getting Exception while running rules
continuously
 on the Event Streams from Mule Component.

 *Drools Version : 5.0.1 *

 *The Drools API used in Mule *:

 drools-api-5.0.1.jar
 drools-compiler-5.0.1.jar
 drools-core-5.0.1.jar

 --
 View this message in context: http://drools.46999.n3.nabble.com/Getting-
 Exception-while-running-rules-continuously-on-the-Event-Streams-from-
 Mule-Component-tp3372189p3372442.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



**
This message is confidential and intended only for the addressee. If you
have received this message in error, please immediately notify the
postmas...@nds.com and delete it from your system as well as any copies. The
content of e-mails as well as traffic data may be monitored by NDS for
employment and security purposes. To protect the environment please do not
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
4EX, United Kingdom. A company registered in England and Wales. Registered
no. 3080780. VAT no. GB 603 8808 40-00

**

___
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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Wolfgang Laun
Looking at the rule I see that you don't really need $activeAlarms :
ArrayList() except for computing $alarms : ArrayList().

Try doing this by a single collect, putting all constraints into the
Alarm() pattern.

-W


On 27 September 2011 15:55, HariKishan
harikishan.tamm...@pass-consulting.com wrote:

 Hi Thomas,

 Those Drools library is part of the Mule ESB 3.2.0
 I think it would be very risky to change the libraries.
 As there might be some version dependencies (Compatibility issues).

 If you have any other idea of how to fix it 

 In the mean while I will checking by replacing the drools library and check
 it.

 Thanks  Regards,
 Hari Kishan T


 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Swindells, Thomas
 Sent: Tuesday, September 27, 2011 6:40 PM
 To: Rules Users List
 Subject: Re: [rules-users] Getting Exception while running rules
 continuously on the Event Streams from Mule Component.

 It may be worth you trying a later version of drools to see whether the
 issue still exists - there have been quite a few bug fixes since then!

 In theory it shouldn't be too much work to change - check the release notes
 for maven group/project id changes, but there are some subtle differences in
 some of the rule syntax validation in places which may or may not make it
 painful.

 Thomas

  -Original Message-
  From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
  boun...@lists.jboss.org] On Behalf Of Hari Kishan
  Sent: 27 September 2011 13:33
  To: rules-users@lists.jboss.org
  Subject: Re: [rules-users] Getting Exception while running rules
 continuously
  on the Event Streams from Mule Component.
 
  *Drools Version : 5.0.1 *
 
  *The Drools API used in Mule *:
 
  drools-api-5.0.1.jar
  drools-compiler-5.0.1.jar
  drools-core-5.0.1.jar
 
  --
  View this message in context: http://drools.46999.n3.nabble.com/Getting-
  Exception-while-running-rules-continuously-on-the-Event-Streams-from-
  Mule-Component-tp3372189p3372442.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


 
 **
 This message is confidential and intended only for the addressee. If you
 have received this message in error, please immediately notify the
 postmas...@nds.com and delete it from your system as well as any copies. The
 content of e-mails as well as traffic data may be monitored by NDS for
 employment and security purposes. To protect the environment please do not
 print this e-mail unless necessary.

 NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
 4EX, United Kingdom. A company registered in England and Wales. Registered
 no. 3080780. VAT no. GB 603 8808 40-00
 
 **

 ___
 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] Partial Unification / Derivation of Facts?

2011-09-27 Thread JohnnyCaimbridge
Let me start from scratch as I'm realizing how difficult it is to understand
my issue.

There is a Fact A with some rules use as conditions.  A can be derived
in several different but mutually exclusive ways.  For the most part, the
rules which define each of these derivations depend on states/conditions
which the rules matching on A are largely agnostic of.

rule rule deriving A
when
   //some conditions
then
   insert( new A(/*some values*/) );
end

rule another rule driving A
when
  //some other conditions
then
  insert( new A(/*some other values*/) );
end

// many other rules deriving A


However, there are also other parameters/values needed for the
computation of the many derivations of A (they need to be present in the
RHSs of rules deriving A).  The combination of these values are
context-dependent to each matching of A /every time/.  That is, each
matching of A has a unique set of values binded to a particular set of
parameters expected by rules deriving A).  Rules deriving A need not and
should not match on these parameters because they are different for every
matching of A; the derivations should (ideally) take on whatever values
are specified in the matching.

rule rule matching on A
when
  $a : A() // needs to somehow convey to the derivation of A() that it
should use a set of values unique to this matching in its derivation
then
  // use $a
end

rule another rule matching on A
when
  $a : A() // needs to somehow convey to the derivation of A() that it
should use a set of values unique to this matching in its derivation
then
  // use $a
end

I cannot leave it up to the rules deriving A to handle every single case
of different values for these parameters--there would be thousands of
different combinations of derivations of A and nobody would understand the
code.

The rules deriving A cannot match on general Parameter objects because
the values in the Parameter objects are unique for each matching of A. 
This would mean that each rule matching A would need a counterpart rule
which asserts the parameters/values needed by the rules deriving A.  I
mean, I suppose this /is/ a solution, but it's obviously difficult to
understand design.

I guess what I'm looking for is something inbetween a function (with
explicitly binded parameters) and a derivation that is rule based--to be
able to say derive this kind of object in any way that you can, but use
these particular values in its derivation.  Perhaps this is not possible.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372828.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Hari Kishan
After Changing to a single Collect ... The Issue is still reoccurring.

*But some Observations *:-

1) Every thing works fine till some time . Suddenly the first time exception
comes ,that is it always the same exception keeps popping . The rules
weren't executed i hope may be the Context is lost or something . 
(Note :-  The above observation is irrespective of the change which i have
done now)

2) when there are 2 Collects , the Exception seem to arrive much earlier
that is (i.e 5-6 mins after the server session started), but after changing
to single Collect the Exception arrived after a long time ( i.e 15 mins
after the server session started) .. May be this is one time
observation, just want to give you some information which may help you
suggest me something. 

3) The lesser the number of conditions the greater the stability of the
application. Drools I think is used for more complex scenarios of the real
world. Our application should not overload the complexity i guess.




--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372930.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Wolfgang Laun
On 27 September 2011 17:25, Hari Kishan
harikishan.tamm...@pass-consulting.com wrote:
 After Changing to a single Collect ... The Issue is still reoccurring.


Another alternative is to use an accumulate to compose the List by
init - action - reverse - result. Perhaps this isn't as vulnerable as
collect appears to be.

-W



 *But some Observations *:-

 1) Every thing works fine till some time . Suddenly the first time exception
 comes ,that is it always the same exception keeps popping . The rules
 weren't executed i hope may be the Context is lost or something .
 (Note :-  The above observation is irrespective of the change which i have
 done now)

 2) when there are 2 Collects , the Exception seem to arrive much earlier
 that is (i.e 5-6 mins after the server session started), but after changing
 to single Collect the Exception arrived after a long time ( i.e 15 mins
 after the server session started) .. May be this is one time
 observation, just want to give you some information which may help you
 suggest me something.

 3) The lesser the number of conditions the greater the stability of the
 application. Drools I think is used for more complex scenarios of the real
 world. Our application should not overload the complexity i guess.




 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3372930.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] Partial Unification / Derivation of Facts?

2011-09-27 Thread Wolfgang Laun
All right: if it is the matching rule that defines the parameter set
you can either define the parameters literally in that rule or you can
create a lookup-table with the rule name as its key. You can obtain
the rule name generically on the RHS, and you can write some code to
make sure that all matching rules identified by some code in their
name have an entry, etc.

The deriving rules don't matter - there is no 1:1-correspondence
between them and the matching ones.

-W

On 27 September 2011 16:53, JohnnyCaimbridge nbo...@nycm.com wrote:
 Let me start from scratch as I'm realizing how difficult it is to understand
 my issue.

 There is a Fact A with some rules use as conditions.  A can be derived
 in several different but mutually exclusive ways.  For the most part, the
 rules which define each of these derivations depend on states/conditions
 which the rules matching on A are largely agnostic of.

 rule rule deriving A
 when
   //some conditions
 then
   insert( new A(/*some values*/) );
 end

 rule another rule driving A
 when
  //some other conditions
 then
  insert( new A(/*some other values*/) );
 end

 // many other rules deriving A


 However, there are also other parameters/values needed for the
 computation of the many derivations of A (they need to be present in the
 RHSs of rules deriving A).  The combination of these values are
 context-dependent to each matching of A /every time/.  That is, each
 matching of A has a unique set of values binded to a particular set of
 parameters expected by rules deriving A).  Rules deriving A need not and
 should not match on these parameters because they are different for every
 matching of A; the derivations should (ideally) take on whatever values
 are specified in the matching.

 rule rule matching on A
 when
  $a : A() // needs to somehow convey to the derivation of A() that it
 should use a set of values unique to this matching in its derivation
 then
  // use $a
 end

 rule another rule matching on A
 when
  $a : A() // needs to somehow convey to the derivation of A() that it
 should use a set of values unique to this matching in its derivation
 then
  // use $a
 end

 I cannot leave it up to the rules deriving A to handle every single case
 of different values for these parameters--there would be thousands of
 different combinations of derivations of A and nobody would understand the
 code.

 The rules deriving A cannot match on general Parameter objects because
 the values in the Parameter objects are unique for each matching of A.
 This would mean that each rule matching A would need a counterpart rule
 which asserts the parameters/values needed by the rules deriving A.  I
 mean, I suppose this /is/ a solution, but it's obviously difficult to
 understand design.

 I guess what I'm looking for is something inbetween a function (with
 explicitly binded parameters) and a derivation that is rule based--to be
 able to say derive this kind of object in any way that you can, but use
 these particular values in its derivation.  Perhaps this is not possible.

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372828.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] Getting Exception while running rules continuously on the Event Streams from Mule Component.

2011-09-27 Thread Hari Kishan
Thanks for your Immediate support . will take your suggestion . change the
collect implementation and try .
will get back to you incase of any more help.

once again thankful for your support.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Exception-while-running-rules-continuously-on-the-Event-Streams-from-Mule-Component-tp3372189p3373059.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] Partial Unification / Derivation of Facts?

2011-09-27 Thread JohnnyCaimbridge
How would I go about implementing the first part to your solution? (where you
say if it is the 'matching' rule that defines the parameter set you can
define the parameters literally in that rule)

I am not aware of any syntax that would permit this type of behavior--that
would allow me to (in the matching rule's condition) literally define the
values the rules deriving A should use, instead of the deriving rule
matching it against working memory (ie to indicate from the matching rule
that the derivation rule should always use a certain value as a condition
rather than matching against working memory).

Given:
rule derivation rule
when
   $prm1 : Param1()
then
  insert( new A($prm1) );
end

, the following indicates that working memory should be pattern matched for
an A with getParam1() == new Param1(val).  Of course, this is not my
desired functionality:
rule matching rule 1
when
   A( param1 == new Param1(val) )
then
   // do w/e
end

What I would like to see is--given the derivation rule above--something
like this:
rule matching rule 2
when
   $a : A( param1 := new Param1(val) )
then
  // do something with $a
end

^ Ideally this would tell the rule derivation rule to attempt to derive
A(), but under the assumption that param1 should be initialized with new
Param1(val) as opposed to strictly matching for it in WM.  However, the
more I look at this, more it seems like backward chaining is necessary...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3373242.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] Partial Unification / Derivation of Facts?

2011-09-27 Thread Wolfgang Laun
You insert some A(), and you can't match an A unless it has been
inserted and is in working memory.

I can't follow you here any more - sometimes things appear to depend
on the rule alone; sometimes (as below) an inserted A is a function of
a matched Param1(). It's impossible to understand things if they
aren't fully put on the table.

-W


On 27 September 2011 18:55, JohnnyCaimbridge nbo...@nycm.com wrote:
 How would I go about implementing the first part to your solution? (where you
 say if it is the 'matching' rule that defines the parameter set you can
 define the parameters literally in that rule)

 I am not aware of any syntax that would permit this type of behavior--that
 would allow me to (in the matching rule's condition) literally define the
 values the rules deriving A should use, instead of the deriving rule
 matching it against working memory (ie to indicate from the matching rule
 that the derivation rule should always use a certain value as a condition
 rather than matching against working memory).

 Given:
 rule derivation rule
 when
   $prm1 : Param1()
 then
  insert( new A($prm1) );
 end

 , the following indicates that working memory should be pattern matched for
 an A with getParam1() == new Param1(val).  Of course, this is not my
 desired functionality:
 rule matching rule 1
 when
   A( param1 == new Param1(val) )
 then
   // do w/e
 end

 What I would like to see is--given the derivation rule above--something
 like this:
 rule matching rule 2
 when
   $a : A( param1 := new Param1(val) )
 then
  // do something with $a
 end

 ^ Ideally this would tell the rule derivation rule to attempt to derive
 A(), but under the assumption that param1 should be initialized with new
 Param1(val) as opposed to strictly matching for it in WM.  However, the
 more I look at this, more it seems like backward chaining is necessary...

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3373242.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] Partial Unification / Derivation of Facts?

2011-09-27 Thread JohnnyCaimbridge
Well, just going back and forth and taking the time to explain my issue / the
functionality I had in mind has helped significantly in my own
understanding, and at the very least I am now confident in what sort of
limitations there are.  So, I don't consider this time a waste, and thanks
for trying to understand me.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3373529.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] Not able to call parameterizied Java method in LHS

2011-09-27 Thread Edson Tirelli
   Assuming callA() and callB() are methods on $C, you are missing a comma
in between them.

modify ($C)
{
 callA(UNIX),
 callB(PERL)
}

   Edson

2011/9/27 Tinku dibya@gmail.com

 I try to add two java method calls in the RHS of the rule .It doesnot allow
 me to save the DRL file in eclipse .It complaints Multiple Markers at this
 line.

 However ,commenting one of the method in the RHS works fine ,with-out any
 issue..

 Could you pls help me in this..

 Example :

 when
 $B : customObject()
 $C :result()

 eval($B.getValue(Database).equals(ORACLE))

 then
 modify ($C)
 {
  callA(UNIX)
  callB(PERL)
 }

 end


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Not-able-to-call-parameterizied-Java-method-in-LHS-tp3372552p3374183.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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Job opening to work on Drools jBPM in Argentina

2011-09-27 Thread Mark Proctor
One of the largest healthcare organisations in Argentina is looking to 
find two senior developers, full time, to work on Drools and jBPM. The 
position is a long term contractual one and you must be based in Buenos 
Aries, Argentina


The work is for RD enhancements to Drools and jBPM, not for building 
end user applications. It involves developing next generation authoring 
environments for rules, workflow and the semantic web. The ideal 
candidates would have a mixed set of skills including java, gwt and 
javascript. Knowledge of Drools and jBPM is a plus, but not mandatory.


You will work day to day with the Drools and jBPM team, as part of their 
community. All your work will be open source and you'll be able to 
evangelise your work via community facilities, such as mailing lists and 
blogs. This provides a unique opportunity to work on high profile 
projects in a public manner and gain recognition for yourself and your work.


You can apply for the job here : 
http://jobs.athico.com/job/senior-java-and-javascript-developer-to-work-on-ciudad-aut-noma-de-017e8dd315 
http://jobs.athico.com/job/senior-java-and-javascript-developer-to-work-on-ciudad-aut-noma-de-017e8dd315 

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