Simple Example / Tutorial
by Robert Burdick
Hello All:
I'm still finding the samples that I've come across far too obtuse to easily
illustrate how JBoss Rules works. I really need the worlds simplest working
example (no missing code files as in many of the examples) with a tutorial /
description that really explains what's going on. You've all been through
this: can anyone share how they got going?
17 years, 3 months
Re: [rules-users] nested accessors with Sets
by mark.mcnally@comcast.net
Edson,
I opened ticket # 1058 for this - http://jira.jboss.com/jira/browse/JBRULES-1058
Thank you,
Mark
-------------- Original message ----------------------
From: "Edson Tirelli" <tirelli(a)post.com>
> Mark,
>
> Hmmm, something is going on with mvel integration... bellow must work.
> There are work arounds (like using plain java code, or using multiple
> patterns), but I think we need to fix that. Can you please include this info
> in the ticket.
>
> Thanks,
>
> []s
> Edson
>
> 2007/8/2, mark.mcnally(a)comcast.net <mark.mcnally(a)comcast.net>:
> >
> > Edson,
> >
> > Thank you for the response. I tried writing the in-line eval as suggested
> > but get this Exception:
> >
> > org.drools.rule.InvalidRulePackage: Unable to determine the used
> > declarations : [Rule name=State, agendaGroup=MAIN, salience=0,
> > no-loop=false]
> > at org.drools.rule.Package.checkValidity(Package.java:408)
> > at org.drools.common.AbstractRuleBase.addPackage(
> > AbstractRuleBase.java:288)
> > at [...]
> >
> > This is my rule:
> >
> > rule State
> > dialect "mvel"
> > when
> > $ca:CandidateAssociation( eval ( !
> > nurseDetails.stateLicensures.contains( patientDetails.state ) ) )
> > then
> > retract( $ca );
> > end
> >
> > I haven't yet but, plan to open an issue in JIRA as requested
> >
> > Thanks for your help.
> > Mark
> >
> >
17 years, 3 months
correlating two collects
by Yuri de Wit
I am finally having some time to use collects. What I basically need
to do is to collect items from a list using a specific criteria, then
collect items from a diff list using another criteria, and finally
compare the groups collected using a 3rd criteria
Here is what I am thinking:
i : Item(type==A)
ig : ItemGroup(size>1)
collect Item(a==i.a, b==i.b, ... n==i.n)
i2: Item(type==B)
ig2 : ItemGroup( size>1,
ga==ig.ga, gb==i.gb, .... )
collect Item(a==i.a, b==i.b, ... n==i.n)
1) It is quite nice that any implementation of java.util.Collection
can be the resut of collect. ItemGroup here not only keeps hold of all
Items returned but has some aggregate properties (afaik, I cannot use
the aggregate functions with accumulate since I have multiple column
aggregation).
2) Am I on the right track? Or is there a better way?
3) Is the collect recomputed from scratch or incrementally every time
a new fact is asserted or updated?
thanks
17 years, 3 months
Need Design Inputs
by shanmu
Hi,
We are currenlty working on a new assignment
where we have a requirement where some mapping
details are available such as
A-->B-->C-->D
The relationship goes like this A has multiple
values of B.Combination of A and B has multiple
values for C and finally combination of A,B,C has
multiple values of D.
User on selecting A the system needs to display
the list of B and selecting a value of B from the
list system displays the lsit of C and so on.
All the request needs to contacts a web service
for retreiving the values.
Based on the anlaysis we have close to around 30K
combination of A,B,C,D.
People adviced me to use Drools for this by
maintainning the combination in rules (DRL) files
is it ideal for using Drools for this kinda
scenario.
I could well achieve the same requirement with a
dynamic query built and fetch the values from
database for each combination.
I feel using Drools would increase the
development time a lot.Also from a maintenance
perspective it might consume lots of effort.
Can anyone advice me what to use? also please let
me know the PRO's and Cons if any?
Thanks
Best Regards
shanmu
"Smile , it improves your face value "
____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kid...
17 years, 3 months
Re: [rules-users] nested accessors with Sets
by mark.mcnally@comcast.net
My rule now appears to be working after switching from the "excludes" operator to the newer "not contains".
This works:
$ca:CandidateAssociation(nurseDetails.stateLicensures not contains patientDetails.state )
This does not:
$ca:CandidateAssociation(nurseDetails.stateLicensures excludes patientDetails.state )
Mark
-------------- Original message ----------------------
From: mark.mcnally(a)comcast.net
> Hello,
>
> Please excuse me if I have double posted - my first did not seem to appear.
>
> I am wondering if the following is valid rule syntax. I am getting a stacktrace
> when the rules fire that points to a ClassCastException on a HashSet
>
> I am using v4.0 GA.
>
> Thank you, Mark
>
>
> rule StateMatch
> when
> $ca:CandidateAssociation(nurseDetails.stateLicensures excludes
> patientDetails.state )
> then
> retract( $ca );
> end
>
>
> public class CandidateAssociation {
> private PatientDetails patientDetails;
> private NurseDetails nurseDetails;
> private int overlapHours;
>
> public CandidateAssociation( PatientDetails patientDetails, NurseDetails
> nurseDetails) {
> super();
> this.patientDetails = patientDetails;
> this.nurseDetails = nurseDetails;
> overlapHours =
> participantDetails.getNumberOverlapHourCnt(nurseDetails);
> }
> [...]
> }
>
> public class NurseDetails {
> private Set stateLicensures = new HashSet();
> [...]
> }
> public class PatientDetails {
> private String state;
> [...]
> }
>
> ------------------------------------------------------
> Firing Rules
> **********
> org.drools.RuntimeDroolsException: Exception executing predicate
> org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> ctSinkAdapter.java:317)
> at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> at
> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> at
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> ializeCandidateForEachNurse_0.java:13)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 403)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 384)
> at
> primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> Caused by: java.lang.ClassCastException: java.util.HashSet
> at
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> va:35)
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> ... 17 more
> org.drools.RuntimeDroolsException: Exception executing predicate
> org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> ctSinkAdapter.java:317)
> at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> at
> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> at
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> ializeCandidateForEachNurse_0.java:13)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> at
> org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4
> 30)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 412)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 384)
> at
> primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> Caused by: java.lang.ClassCastException: java.util.HashSet
> at
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> va:35)
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> ... 18 more
> Exception in thread "main" org.drools.spi.ConsequenceException:
> org.drools.RuntimeDroolsException: Exception executing predicate
> org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:507)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:467)
> at
> org.drools.common.AbstractWorkingMemory.doOtherwise(AbstractWorkingMemory.java:4
> 30)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 412)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:
> 384)
> at
> primarynursePOC.PrimaryNursePOC.selectPrimaryNurse(PrimaryNursePOC.java:136)
> at primarynursePOC.PrimaryNursePOC.main(PrimaryNursePOC.java:91)
> Caused by: org.drools.RuntimeDroolsException: Exception executing predicate
> org.drools.base.mvel.MVELPredicateExpression@27d6bfb
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:197)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:121)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObje
> ctSinkAdapter.java:317)
> at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
> at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> at
> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
> at
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:64)
> at
> org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:58)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0.consequence(Rule_Init
> ializeCandidateForEachNurse_0.java:13)
> at
> org.drools.examples.Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.eva
> luate(Rule_InitializeCandidateForEachNurse_0ConsequenceInvoker.java:25)
> at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:503)
> ... 6 more
> Caused by: java.lang.ClassCastException: java.util.HashSet
> at
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.ja
> va:35)
> at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:191)
> ... 18 more
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 3 months
drools-example-brms
by David Nogueras
Hi, I´m trying to run the brms sample and i get the next output:
RuleAgent(insuranceconfig) INFO (Thu Jul 19 14:27:44 CEST 2007): Configuring
with newInstance=true, secondsToRefresh=30
RuleAgent(insuranceconfig) INFO (Thu Jul 19 14:27:44 CEST 2007): Configuring
package provider : URLScanner monitoring URLs:
http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme...
local cache dir of D:\workspace2\drools-example-brms\cache
RuleAgent(insuranceconfig) WARNING (Thu Jul 19 14:27:44 CEST 2007): Falling
back to local cache.
java.lang.NullPointerException
at org.drools.agent.FileScanner.readPackage(FileScanner.java:101)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:79)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:57)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:93)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:291)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:259)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:228)
at org.drools.agent.RuleAgent.init(RuleAgent.java:160)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:169)
at org.acme.insurance.launcher.InsuranceBusiness.loadRuleBase(
InsuranceBusiness.java:26)
at org.acme.insurance.launcher.InsuranceBusiness.executeExample(
InsuranceBusiness.java:14)
at org.acme.insurance.launcher.MainClass.main(MainClass.java:13)
could someone help me?
17 years, 3 months
SAP Netweaver
by Heyns, Juan
Hi,
I have posed the question on IRC before:
Has anybody used JBoss Rules with SAP Netweaver application server? I am
curious whether anybody has managed to integrate the eclipse plugins
into the the SAP NetWeaver Developer Studio (which is Eclipse 2.1.2
based btw).
If anyone has any experiences to share, please let me know. Otherwise I
will give some feedback after my attempt.
Regards
Juan
"Employees of Lonmin Platinum ("Lonplats") are not authorised to conclude
electronic transactions or to enter into electronic agreements on behalf
of Lonplats. Any electronic signature (other than an advanced electronic
signature as defined in the Electronic Communications and Transactions
Act of 2003) added to a data message (such as an email or an attachment
to an (email) ostensibly on behalf of Lonplats by a Lonplats employee shall
not be legally binding on Lonplats and Lonplats shall incur no liability of
any nature whatsoever, directly or indirectly, arising from such act on the
part of it's employee. It is further recorded that nothing (other than an
advanced electronic signature) inserted into any data message
emanating from Lonplats shall be construed as constituting an electronic
signature"
17 years, 4 months
RuleFlow process has no id !?
by hypnosat7
Hi,
I draw a rule flow with only 2 ruleFlowGroup, I set the process id in the
properties view but when I tried to check my rule flow I had this : ruleFlow
process has no id
this is my ruleFlowTest.rf file :
<org.drools.ruleflow.core.impl.RuleFlowProcessImpl id="1">
<nodes id="2">
<entry>
<long>2</long>
<org.drools.ruleflow.core.impl.RuleSetNodeImpl id="3">
<ruleFlowGroup>ruleSet1</ruleFlowGroup>
<id>2</id>
<name>RuleSet1</name>
<incomingConnections id="4">
<org.drools.ruleflow.core.impl.ConnectionImpl id="5">
<type>1</type>
<from class="org.drools.ruleflow.core.impl.StartNodeImpl"
id="6">
<id>1</id>
<name>Start</name>
<incomingConnections id="7"/>
<outgoingConnections id="8">
<org.drools.ruleflow.core.impl.ConnectionImpl
reference="5"/>
</outgoingConnections>
</from>
<to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl"
reference="3"/>
</org.drools.ruleflow.core.impl.ConnectionImpl>
</incomingConnections>
<outgoingConnections id="9">
<org.drools.ruleflow.core.impl.ConnectionImpl id="10">
<type>1</type>
<from class="org.drools.ruleflow.core.impl.RuleSetNodeImpl"
reference="3"/>
<to class="org.drools.ruleflow.core.impl.RuleSetNodeImpl"
id="11">
<ruleFlowGroup>ruleSet2</ruleFlowGroup>
<id>3</id>
<name>RuleSet2</name>
<incomingConnections id="12">
<org.drools.ruleflow.core.impl.ConnectionImpl
reference="10"/>
</incomingConnections>
<outgoingConnections id="13">
<org.drools.ruleflow.core.impl.ConnectionImpl id="14">
<type>1</type>
<from
class="org.drools.ruleflow.core.impl.RuleSetNodeImpl" reference="11"/>
<to class="org.drools.ruleflow.core.impl.EndNodeImpl"
id="15">
<id>5</id>
<name>End</name>
<incomingConnections id="16">
<org.drools.ruleflow.core.impl.ConnectionImpl
reference="14"/>
</incomingConnections>
<outgoingConnections id="17"/>
</to>
</org.drools.ruleflow.core.impl.ConnectionImpl>
</outgoingConnections>
</to>
</org.drools.ruleflow.core.impl.ConnectionImpl>
</outgoingConnections>
</org.drools.ruleflow.core.impl.RuleSetNodeImpl>
</entry>
<entry>
<long>1</long>
<org.drools.ruleflow.core.impl.StartNodeImpl reference="6"/>
</entry>
<entry>
<long>3</long>
<org.drools.ruleflow.core.impl.RuleSetNodeImpl reference="11"/>
</entry>
<entry>
<long>5</long>
<org.drools.ruleflow.core.impl.EndNodeImpl reference="15"/>
</entry>
</nodes>
<variables id="18"/>
<lastNodeId>5</lastNodeId>
<name>ruleFlowTest</name>
<type>RuleFlow</type>
</org.drools.ruleflow.core.impl.RuleFlowProcessImpl>
--
View this message in context: http://www.nabble.com/RuleFlow-process-has-no-id-%21--tf4211011.html#a119...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 4 months