are not clear. Thank you for helping.
Edson
2009/3/15 Wolfgang Laun wolfgang.l...@gmail.com
From Drools-5.0.0, Expert, 7.8.1. Sentence numbers added by me:
[1] when a ruleflow-group becomes active or an agenda-group receives the
focus
any rules that have lock-on-active set to try cannot
On Mon, Mar 16, 2009 at 6:24 AM, Nikhil_dev k.nik...@verchaska.com wrote:
As you guys have suggested to combine all the rule base into one then for
example(one which i have already mentioned)
i will combine Rule1 , rule 2 and rule3 into 1 rule base then, when i pass
the variables to the
As far as I know, this should work:
package orel;
import orel.Main.Trigger;
rule ror1
when
$t : (or Trigger(fa == 1)
Trigger(fa == 2))
then
System.out.println( fired + $t.getName() );
end
This is what Drools-5.0.0 kbuilder.getErrors().toString() returns:
2009/3/16 Edson Tirelli tire...@post.com
This is an old discussion. Single binding on or is a non-orthogonal
special case on the language syntax that was introduced in the early days
when we only had infix CEs. When we started to support prefix CE, the
special case was not updated, and as
It appears that you want to reason about travel bookings or some such thing.
You are thinking of the various attributes as individual (abstract) things
that
have a designation (such as Adult Fare) and a value, with the intent to
handle this with a set of facts, each of which has these two fields.
You don't need forall to solve your problem. The following rule prints all
patient names which don't have problem 4711; omitting the 'not' prints
those suffering from Colognitis.
rule lookJoe
when
$patient: Patient()
not ( Problem( code == 4711 ) from $patient.problemList )
The figures you gave just indicate that you have a good balance between I/O
and CPU load. The increase between no rules and ~60 rules is to be
expected
as all the work is being done during fact insertion. Of course, adding more
and
more rules will, eventually, push the CPU load factor to the
Could you describe the data you have in the DB and the types of your facts.
Above all, do provide some examples.
-W
2009/3/31 Meny Kobel meny.ko...@gmail.com
Hi,
Any updates regarding this subject?
I have the same problem and can't find a solution.
Like newbie I need to read varying rules
Maybe I'm missing something but couldn't you simply create checkGroups as a
SetStringand just compare its size() to $fact.Groups.size() ?
rule check
when
$fact : StrColl( $gr : groups, eval( $gr.size() != (new HashSet( $gr
)).size() ) )
then
System.out.println( failed );
(this != $group1, index == $index)
then
System.out.println($group2 + has a duplicate index );
end
2009/4/17 Wolfgang Laun wolfgang.l...@gmail.com
Maybe I'm missing something but couldn't you simply create checkGroups as
a SetStringand just compare its size() to $fact.Groups.size
The best way to do that would be to write the field constraints for
testValue to check for exact ranges. You want, for instance to set percent
to 15 if, and only if
Test( testValue 50 = 80)
As an alternative, write a function percent(int tv) computing the percent
value and do
rule RuleX
The long answer to your question can be found in
http://en.wikipedia.org/wiki/Floating_point.
The short answer is that machine numbers for floats and doubles are
approximations to almost all rational numbers, or, if you prefer, fractions.
This is because most numbers have infinite binary
One thing that's not clear to me, but essential to a discussion of this
problem: How do write (or even define) the rules if you don't know the
actual properties the incoming Beans will have?
-W
2009/4/21 Tina colemanseri...@gmail.com
I'm trying to get a handle on whether Drools is the right
Have you considered the simple fact that a month may have between four
(full) and six (one or two fractional) weeks? Reminder objects ought to have
a field identifying the week; if they have its easy to count them per week
if they are simple facts in WM.
Note that the identificaton of weeks by
Create a single fact, say Clock, with a field time. Assuming that this value
is updated once in a while, depending on the precision with which your time
supervision should work, you may then write rules such as
rule extract
when
Clock( $time : time )
e1 : Event (code == LOGON, status ==
This is what you might do:
KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kBuilder.add( ResourceFactory.newFileResource( Movie.drl ),
ResourceType.DRL );
There is no such thing as the point in flow of control where a rule's
'when' is executed. It is the foremost purpose of the Rete algorithm to
avoid these straightforward evaluations of the LHS conditions as rule
programmers see them in the rule text. Instead, LHSides are taken apart (by
the rule
I cannot reproduce your findings.
Which bmi values cause the firing of two rules?
Are you using exactly the same .drl file Greg sent?
-W
2009/5/4 Femke De Backere femm...@gmail.com
Thanks for the answer! But I sometimes get 2 rules that are correct, and
that is impossible. I embedded Greg's
heeft Wolfgang Laun het volgende
geschreven:
I cannot reproduce your findings.
Which bmi values cause the firing of two rules?
Are you using exactly the same .drl file Greg sent?
-W
2009/5/4 Femke De Backere femm...@gmail.com
Thanks for the answer! But I sometimes get 2 rules
solved the problem by removing every double in the sample.drl. How van I
fix the double problem if I really wanted to :)? In this case it is
unnecassary but there must be a solution?
Thanks for all the help!
Femke
Op 4-mei-09, om 21:48 heeft Wolfgang Laun het volgende geschreven:
Don't use
Rectangles or simple polygons or worse?
-W
On Fri, May 8, 2009 at 9:02 AM, Olaf Raether o.raet...@epro.de wrote:
Hey , i would like to use drools solver for a 2d knapsack problem.
Has anyone expirience with that ?
Is drools solver made for such a task ?
Thank for hints
Olaf Raether
problem more efficiently.
-W
On Fri, May 8, 2009 at 9:59 AM, Olaf Raether o.raet...@epro.de wrote:
Rectangles within a Rectangle
OR
Wolfgang Laun-2 wrote:
Rectangles or simple polygons or worse?
-W
On Fri, May 8, 2009 at 9:02 AM, Olaf Raether o.raet...@epro.de wrote:
Hey
.
And i have to
put them on the truck. And the Business rules come into the play, cause the
racks can only
mounted in a special manner on the track.
Any hint is welcome
Wolfgang Laun-2 wrote:
I've researched this, a long time ago (trying to find a solution for a
problem from the worse
What about setting the field to 0 in the constructor of Salary?
Or using float (not java.lang.Float)?
-W
2009/5/13 Shabbir Dhari sdh...@hotmail.com
I know this work around. But I have more than 50 rules using that
attribute and it looks very ugly to put null on every rule and its not
single
But you do control the insertion of your facts. Rather than cluttering rules
with conditions dealing with irregular values, preprocess the object. And
you should be able to log from there, just as well.
-W
2009/5/13 Shabbir Dhari sdh...@hotmail.com
I can not initialize property as need to log
Well, I hope you get paid for all the extra work ;-)
Define, in your .drl file,
function float safe( Float v ){
return v == null ? 0 : v;
}
and wrap all references to the dangerous field(s) in your LHS pattern
expressions with this call, except, of course, in the rule where you fix and
2009/5/13 Shabbir Dhari sdh...@hotmail.com
Thanks for all you efforts :) but what is the difference between calling
function from every rule or putting null check.
It's much easier to add.
I give up. I am looking for other rule engines.
As they must apparently (due to JavaBeans) be
I think that the overloaded method for starting a process
ksession.startProcess( String name, MapString,Object name2var )
is what you want.
-W
On Wed, May 13, 2009 at 4:17 PM, Brad Stone bst...@menloware.com wrote:
Shannon Lal shannonlal2909 at gmail.com writes:
Brad,Can you provide
All right, let's hope that business user is up to write the rules, even
without null checks ;-)
Seriously now: are they up to handling monetary units represented as
floating point numbers? A recent thread has emphasized the problems arising
from tests such as floatVal = floatConst, and I've been
Assuming that your facts are structured as the indentation suggests, I would
solve this using a technique you could call virtual field. So, if a fact
object has fields
String title
ListPropGroup pgList
and a PropGroup has fields
String name
ListString pList
I would not try to get at
of all names allNames; call fireAllRules; then in the DRL, for each
Title compare Proprietor names (set) with allNames.
How can I compare 2 sets like this in a DRL ?
Ian Spence
2009/5/14 Wolfgang Laun wolfgang.l...@gmail.com
Assuming that your facts are structured as the indentation suggests, I
For repeated changes of a fact (the Score thing, in your case) a stateful
session should be used. Then, the update of your Score fact would be
modify( s ){
setValue( s.getValue() + 4 ) // 4 or whatever
}
Repeated firing of the threshold rule is due to the Engine's reassessment
of
Drools is very well equipped for handling large fact collections. As to the
examples you cite, #1 and #2 are simple, as you apparently know. As for #3,
check the documentation on the collect and accumulate patterns, which
should satisfy you that it can be implemented without undue strain. (To wit:
You are confusing several issues here. I take it that the ClassCastException
is
an error that occurs while you insert facts. At that time, all rule
compiling has
been done and the rulebase has been built. A ClassCastException is not a
problem of some class or other being loaded (by Java's own
There is an all too easily overlooked sentence in the Drools Flow User Guide
in Section 3.2, whereas the code samples don't feature this call at all.
-W
2009/5/21 David Sinclair dsincl...@chariotsolutions.com
You are missing the kession.fireAllRules() after the
Well, it's definitely not forbidden to do a little computational work on the
RHS, too.
Bind the result to a variable:
Number( $times : intValue 10 )...
and, on the RHS, do
for( int i = 1; i = $times % 10; i++ ) shout( alarm );
or whatever.
-W
On Thu, May 21, 2009 at 4:21 PM,
I also think that the approach proposed by Greg of having a Message fact
type and various Segment fact types would let you write efficient and
maintainable rules. (The extreme splitting into Field facts has several
drawbacks, as has been pointed out, and also: 'value' is always a string,
so you
The first two patterns pair each driver assignment with each trip -
which is quite a lot of work to do. (The infix and between the 2nd
and 3rd pattern doesn't change this.) Also, the field restriction
tripId in ($tid) is not the most efficient way.
Try this:
rule Assignment Check
when
$creVo:
But assigning a value to a global isn't straightforward - you can't do
it in the declaration. You'll have to do it from the application (or
use some dirty hack, in a start-up rule); either way it's separate
from the declaration.
IMHO, using a Java class with public static final is definitely
On 6/4/09, Garner, Shawn garner.sh...@principal.com wrote:
2) How do you use the test scenarios with complex object structures?
-eg Create a fact in working memory that has another Object in it
which in turn has a list of Objects in it.
-Seems like any Fact in working memory is
I have a few idle days starting this weekend. I have some (real-world)
experience doing 2D graphics with AWT, so I might qualify ;-)
Send me the specs, please, unless you are already crowded by applications.
-W
On 6/3/09, Edson Tirelli tire...@post.com wrote:
Hey people,
To achieve a
For instance:
ksession.getAgenda().getAgendaGroup( Group A ).setFocus();
-W
2009/6/12 Earnest Dyke earnied...@yahoo.com
Converting a 4.0.7 project to 5.0.1 and StatefulKnowledgeSession does not
have a .setFocus method like StatefulSession has. How do I accomplish the
same function in
The traffic on this list is quite substantial. Note that it is used if
people run
into a problem, not when they solve one. Judging Drools' industry usage from
the traffic here is akin to saying that fine weather is tied to the Moon
being
full, which you don't see when it is new nor when the sky is
This sounds very much like the problem I ran into earlier this week.
Kris has fixed it, on trunk.
-W
On 6/12/09, tom tom...@gmx.at wrote:
Hi there! I am using drools 5.0 final. I tried to implement 2 subflows which
are polling for database entries.
More exactly: my application consists of 1
Using a fact as a guard to block alternatives is tricky. For one thing, you
cannot use a single global fact. (When would you reset this fact to the
initial state so that the whole mechanism can work again for the next fact
set to be processed by this rule set?) So, you might consider inserting a
I've been doing similar things in an ESME (direct SMSC connection) but
without rules, as the conditions were much simpler, and just handling SMS
messages themselves.
I guess you'll base your decision on billing records, possibly in connection
with subscriber data. Billing records might be a bit
One good way of producing results from rules is indeed to create and insert
an object
as a fact. The idiom on the RHS is
inser( new DroolsResult(...) );
The application could retrieve this with a query over all DroolsResult
facts, and
then retract the fact so that your WM is ready for another
:35 +0200, Wolfgang Laun wrote:
I've been doing similar things in an ESME (direct SMSC connection) but
without rules, as the conditions were much simpler, and just handling SMS
messages themselves.
I guess you'll base your decision on billing records, possibly in
connection with subscriber
It's impossible to diagnose exactly what goes on without seeing the LHS
patterns in detail. One possible reason for the rules rule[234] in groupX
not firing the second time that group is given focus is that none of the
objects participating in the LHS of the three rules has changed since the
first
The Expert User Guide, section 2.5.7.3., Agenda Filters, is probably
what you are remembering. Also, see the javadoc on
org.drools.runtime.rule, interface StatefulRuleSession, method void
fireUntilHalt(AgendaFilter agendaFilter) etc.
-W
On 6/25/09, Chris Richmond crichm...@referentia.com wrote:
You might use the API to retrieve all rules in your KnowledgeBase
KnowledgeBase kBase = ...;
for( KnowledgePackage kp: kBase.getKnowledgePackages() ){
for( Rule r: kp.getRules() ){
String name = r.getName();
String purpose = r.getMetaAttribute( Purpose ); // or
You can use a KnowledgeBuilder with template-derived DRL-resources and set
up your KnowledgeBase from its results the same way you do it with plain
.drl-files. Obtain a StatefulKnaowledgeSession and pass this to
the KnowledgeRuntimeLoggerFactory, as in your first code sample.
-W
On 6/30/09,
While thinking this over, several things have come to my mind.
(1) Obviously you are using double for representing monetary values. This is
dangerous, as even simple calculations may result in values that are not
acceptable due to accounting customs or tax laws.
(2) The effort for checking is
rulesSession.fireAllRules();
/pre
Wolfgang Laun-2 wrote:
You can use a KnowledgeBuilder with template-derived DRL-resources and
set
up your KnowledgeBase from its results the same way you do it with plain
.drl-files. Obtain a StatefulKnaowledgeSession and pass this to
the KnowledgeRuntimeLoggerFactory
The rule is capable of locating two different facts of type PlaceHolder
because you wrote it that way: one is supposed to have a field
value equal to 1, and the other one equal to 2. (Clearly, there cannot
be one fact where value equals 1 and 2 at the same time.)
Drools (and other rule-based
The concept of executing a rule isn't useful. Rules are written to fire
whenever their conditions are met by some set of facts. So, if all of your
rules fire, then all conditions are met.
Consider the condition defining the single rule you want to fire. Can this
condition be derived from one or
Quite right, since not(not(Foo())) is equivalent to exists(Foo()).
Martin, would you please submit a JIRA?
-W
On 7/13/09, Chivotario Martin chivota...@gmail.com wrote:
Hi Visu,
My understanding (also tested) is that activations are created no matter the
knowledge base has the rule packages
allows me to open this a a JIRA i would try to understand how to
use it :D and would do so.
Regards,
Manuel.
2009/7/13 Wolfgang Laun wolfgang.l...@gmail.com
Quite right, since not(not(Foo())) is equivalent to exists(Foo()).
Martin, would you please submit a JIRA?
-W
On 7
,
because both rules are present :D.
However, thanks for creating the issue !
Regards,
Manuel.
2009/7/13 Wolfgang Laun wolfgang.l...@gmail.com
https://jira.jboss.org/jira/browse/JBRULES-2206 created.
Thanks for the code!
-W
On 7/13/09, Chivotario Martin chivota...@gmail.com wrote:
Hi
The second accumulate has amountInPence 0 but the values in your
data are all positive. Therefore,...
-W
2009/7/14 Richard Sherman rsherman...@hotmail.com:
Thanks Wolfgang,
Here's the extra information as requested.
Firstly the When creating the email I was removing all references to rent
For simplicity's sake, I'll only consider the first example, where all
transactions with amount 0 are also Type 1.
Let P be the sum of the positive values and N (0) the sum of the
negative values over all transactions. Then
$charges = P
$adjustment = 29/336*N
intValue = -P - N
The last
2009/7/15 Edson Tirelli tire...@post.com:
Aldian,
Yes, this is the way to go:
rule detect and set routers different from root for alarm 45
When
* All routers which index is different from 0 are raising the alarm 45
* There is an alarm $a of numero 45 raised by an equipement $e
accumulate is indeed complex; the simpler collect might be applicable
as well in this case.
rule all45_A
when
forall ( Equipment( parent == 0, $id : id )
Alarm( cause == 45, source == $id ) )
$alarms : ArrayList()
from collect( Alarm( cause == 45, $source : source ) )
Well, you can't change a Java object Boolean b; assigning another Boolean to b
changes the object reference stored in b. Boolean has no setters.
Notice that the CE
when
Boolean()
always is true irrespective of the Boolean object that's in the WM.
If writing a Java fact class
[Our apologies if you receive duplicates of this posting]
Call for Submissions
3rd International Rules Challenge
at
RuleML-2009
co-located with the Business Rules Forum
November
It's difficult to suggest an optimized form for your rules 1-infinity, since
we do not know what you want to achieve.
The crude duplication of rules where only the constant to be matched with
Product.id varies can, most likely, be avoided.
-W
On Sun, Jul 19, 2009 at 3:15 PM, nesta
, besides this, the price is affected by usage. I want to use
Product.id to match the rules.
As you mentioned The crude duplication of rules where only the constant to
be matched with
Product.id varies can, most likely, be avoided.
How to avoid it in this scenario?
Wolfgang Laun-2 wrote:
It's
On 7/23/09, Olaf Raether o.raet...@epro.de wrote:
The code looks like this:
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
for (int i = 0; i rules.length; i++) {
Package pkg = getPackage(i);
ruleBase.addPackage(pkg);
}
I'd expect to find Package pkg = rules[i]; or
());
}
---
Hope this helps - to help me !
Wolfgang Laun-2 wrote:
On 7/23/09, Olaf Raether o.raet...@epro.de wrote:
The code looks like this:
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
for (int i = 0; i rules.length; i
Could it be that the fact where the NPE happens during its insert contains a
field of some wrapper type (e.g.)Integer that's null and needs to be
converted to a simple type (e.g. int)?
But the same NPE should happen when you insert the same fact with rules
coming from a single file - but you'll
Does your Destination class have a field FieldMember?
-W
2009/7/29 Divya Rajendranath divya.rajendran...@gmail.com
Hi,
I am setting an ArrayList as a Global on my drools session by saying ...
StatefulSession drlSession = getRuleManager().getSession();
drlSession.setGlobal(myMailingList,
The global ao must be assigned to the ksession, from your Java code, by
calling
ksession.setGlobal( ao, assertionObject )
before you do anything that triggers LHS evaluations. See Drools Expert,
section 4.5.2.
The WM and rule setup as you present it does not make sense (to me). If you
insert
2009/8/5 Mark Proctor mproc...@codehaus.org
Ken Archer wrote:
The jboss.org documentation describes rule templates as an experimental
feature. In particular, the API is subject to change. However, the Red
Hat documentation does not caveat rule templates as experimental in any
way. Are
In gameWinner == PARTICIPANTS.HOME.getId(), the second operand isn't an
enum, it's a method call on an enum object. Hence, it must be written as a
Return Value Restriction (cf. Expert doc on a Rule's LHS), thus
..., gameWinner == ( PARTICIPANTS.HOME.getId() ), ...
-W
2009/8/6 Zevenbergen,
Your goal and the presented code aren't clear to me. The consequence (after
then) contains calls to static/class methods (Box.setX()) which isn't going
to change anything in your fact object. The call b.setX() might change your
object, but this depends on what the class method Box.getX() returns.
quote
It is rather common for people to write something like (not (exists (A))),
but this is just a very inefficient way to write (not (A)).
/quote
Kudos to Ernest Friedman-Hill to put this sentence into the Jess
documentation.
Maybe I should quote hiom in the Drools Expert doc ;-)
-W
On
These classes are not part of the stable API, which is considered safe,
i.e., not
threatened by future changes. Also, the lack of javadoc is appalling. And
if that's not enough, creating and maintaining any but the simplest LHS
compositions programmatically is a mind-straining exercise, for which
Hi Edson,
love this one – (!) a marvellous case of To See and See Not ;-)
Lindy copy-pasted the Vote.drl from the cited HTML page which must have been
run over by some text processor which promptly converted space surrounded
hyphens into an EN DASH, codepoint 0x2013 = 8211.
-W
2009/8/25 Edson
See below.
On Fri, Aug 28, 2009 at 12:49 AM, tim fulcher
against.entr...@googlemail.com wrote:
Hi
Making no bones about it, this is a broad topic request and I've got
little hands-on Drools experience, just looking for some pointers on a
potential Drools approach, feedback appreciated.
Hi Tom,
your understanding of Activation is fine, so let's see what happens if
your rule RS... fires. (I'm abbreviating names.)
Initially, neither PolSet nor PolSetId are there, so RS... activation #1
is on the agenda, fires and executes the consequence.
Now, PolSet is created and inserted as a
It depends whether you are a purist, a pragmatist, or a maverick. A few
random thoughts, and note that I consider myself a repenting pragmatist ;-)
Having fact classes with methods that modify the object in addition to the
usual setters is dangerous; a toString() according to the convention is
A rule has to ascertain that all elements in a ListElemBoxStatusin a
Collector occur in the matching BoxResponse's SetElemBoxStatus. There is
just one BoxResponse per Collector.
This here works fine:
rule matchCollectorResponse
when
$c : Collector( $ebsList : elemBoxStatusList, $gsSet
If your 200K rules are all of the same few patterns (1, 2 and 3 attribute
equalities)
then expanding this into all combinations may not be the way to go.
Can you provide a little more detail about whether the 1/2/3 attributes are
always from the same fact type, and how many of these
The rules for a lexer are bound to be all of the same standard pattern:
rule FirstDigit
salience 0
where
$i : Input( $ch : character matches \d )
$l : Lexer( state == State.IDLE, $buf : buffer )
then
$buf.setLength( 0 ); $buf.append( $ch );
modify( $l
A returnValue restriction takes the form
field relop ( expression )
(homeHalfTimeScore + awayHalfTimeScore) 0
=
homeHalfTimeScore ( - awayHalfTimeScore )
-W
On 9/4/09, Zevenbergen, Alex azevenber...@paddypower.com wrote:
Hi all,
This rule clause fails to evaluate, I am
Systems
Rule Systems on the Web
13:45 Challenges for Rule Systems on the Web. Yuh-Jong Hu, Ching-Long Yeh
and
Wolfgang Laun
14:00 A modest proposal to enable RIF dialects with limited forward
compatibility. Christiane de Sainte Marie
14:15 RIF RuleML Rosetta Ring: Round-Tripping the Dlex Subset
You cannot bind a variable to a function result, as in $word :
hasForbiddenWordsSet( ... ).
I'd use the original boolean function hasForbiddenWordsSet (which might even
include the check against getTitle() returning null), and add another
function, returning the string, to be called after 'then'.
One proposal: Don't put the values to which you compare the attributes into
rules; put them into additional facts. Consider:
rule bounds_a_1_10
when
Fact( a = 1 = 10 )
then ... end
and similar for 11:100, 101:1000,... could be handled by a single rule and
a set of Limit-type facts:
rule
Collecting stuff from several matches into a single Collector fact is best
done
by letting matches occur with rules at salience N. Then, put a single rule
matching the Collector, without any constraints, at salience N.
This matches any Collector fact, and, in the consequence you should
remove
On Tue, Sep 29, 2009 at 12:43 AM, Dave Schweisguth d...@schweisguth.orgwrote:
Greetings fellow Droolers,
I've just begun using Drools and am very happy with it so far as it seems
to
be a great fit for what we want to do. My left hand sides are not quite
beautiful enough, however, and I
If there are two different .drl files in the same package each of which
contains a function with name x, and if we have calls to x in both files,
expecting to call the local x, respectively:
(a) if the function signatures are identical, then this compiles without
errors, but at runtime only one
Check the Expert manual. What you need here is a so-called Return Value
Restriction where you relate a field and a parenthesized expression using a
relational operator; i.e.: field op ( expr )
Therefore, $b/$c = 105 is not correct, but $b = ( 105*$c ) is (apart from
possible truncation if $b and
2009/10/2 Vladimir Perlov vladp...@hotmail.com
Here is the rule that failed to compile on Linux:
rule TEST
dialect mvel Send
when
map : Map()
$map : Map()
or omit '$' in the consequence.
-W
then
System.out.println($map.get(x).getSomeMethod());
Map() in the .drl file is bound to be interpreted as MapObject,Object so
that a Map.get() returns an Object. To be able to call method
getSomeMethod() you'd have to cast this result, according to
((SomeClass)$map.get(x)).getSomeMethod()
I fail to understand how this could ever be avoided -
The Java code in the archive just compiles a .drl file, and there's no
reason this should fail. The class cast would only appear to be missing
after a Map object is inserted into WM, and the session is run so that the
rule fires.
-W
2009/10/2 Vladimir Perlov vladp...@hotmail.com
It's compiled
I see no cogent reason for implementing Identifiable for each fact class.
The hashCode() any object returns should be distinct enough, especially
considering that all the hash codes are munched together, which is
definitely not *guaranteed* to result in different values for *all* rule and
fact set
No, globals can only be set by calling the WorkingMemory method
wm.setGlobal(String name, Object value)
You could call this in a consequence (RHS), but it's usually not a good idea
to do so.
What do you want to achieve?
-W
2009/10/14 Chris Richmond crichm...@referentia.com
Shouldn’t it
:
rules-users-boun...@lists.jboss.org] *On Behalf Of *Wolfgang Laun
*Sent:* Wednesday, October 14, 2009 7:50 AM
*To:* Rules Users List
*Subject:* Re: [rules-users] setting globals in rule file
No, globals can only be set by calling the WorkingMemory method
wm.setGlobal(String name, Object
this and call it?
Thanks
Chris
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Wednesday, October 14, 2009 8:15 AM
To: Rules Users List
Subject: Re: [rules-users] setting globals
...@lists.jboss.org [mailto:
rules-users-boun...@lists.jboss.org] *On Behalf Of *Wolfgang Laun
*Sent:* Wednesday, October 14, 2009 8:50 AM
*To:* Rules Users List
*Subject:* Re: [rules-users] setting globals in rule file
I've used functions with Drools 5, but not with MVEL. A recent thread
seemed
1 - 100 of 2589 matches
Mail list logo