Re: [rules-dev] Fine Grained Property Change Listeners (Slot Specific)
by Swindells, Thomas
The change is reducing the coarseness of the system and so making it more sensitive to the scope of the change so I'd say high fidelity is the correct term.
I agree with you I'm concerned how this works with non-pure java beans where some of the setters may update multiple fields, or there may be none bean methods like a reset() method - I don't understand how these would interact in the system, is there a mechanism to explicitly invalidate a property or mark the whole lot as dirty.
Thomas
From: rules-dev-bounces(a)lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 14 January 2012 08:59
To: Rules Dev List
Subject: Re: [rules-dev] Fine Grained Property Change Listeners (Slot Specific)
You really should follow naming conventions Java programmers are familiar
with. javax.xml.bind.annotation.XmlAccessType, for instance, uses the
term "member" for referring to "public getter/setter pairs", and this comes
close to what Drools does. Alternatively, there's "field" and "property",
and I wouldn't worry about the extra lip mileage - you can always abbreviate
to "prop-specific".
Is this new feature in some way configurable for the KnowledgeBase?
There are fact types where modifying one member results in the change
of more than one member. Consider the very plausible case:
$f: Fact(...)
then
modify( $f ){ getList().add( $x ) }
end
when
Fact( size > 10 ) # size implemented as getList().size()
then
Wolfgang
PS: The new feature is actually restricting the sensitivity of the system.
Therefore, I feel that "high-fidelity" is actually counter-intuitive!
On 13 January 2012 23:30, Mark Proctor <mproctor(a)codehaus.org<mailto:mproctor@codehaus.org>> wrote:
Mario just got a first cut working for fine grained property change
listeners. Previously when you call update() it will trigger revaluation
of all Patterns of the matching object type in the knowledeg base.
As some have found this can be a problem, forcing you to split up your
objects into smaller 1 to 1 objects, to avoid unwanted evaluation of
objects - i.e. recursion or excessive evaluation problems.
The new approach now means the pattern's will only react to fields
constrained or bound inside of the pattern. This will help with
performance and recursion and avoid artificial object splitting. We
previously discussed this here:
http://blog.athico.com/2010/07/slot-specific-and-refraction.html
You can see the unit test here:
https://github.com/droolsjbpm/drools/blob/ca55c78429cbc0f14167c604c413cdc...
The implementation is bit mask based, so very efficient. When the engine
executes a modify statement it uses a bit mask of fields being changed,
the pattern will only respond if it has an overlapping bit mask. This
does not work for update(), and is one of the reason why we promote
modify() as it encapsulates the field changes within the statement. You
can follow Mario's chain of work on this at his github activity feed:
https://github.com/mariofusco.atom
The adventerous amoung you can pick this up from hudson, or from maven,
and start playing now. My hope is that this will make drools much easier
to use:
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/d...
Btw we are after a name. Drools is not a frame based system, so "slot
specific" doesn't seem appropropriate. Property Specific seems a bit of
a mouth full. I'm quite liking High Fidelity Change Listeners :) any
other suggestions?
slot-specific is the name used by Jess for this feature,
http://www.jessrules.com/docs/71/constructs.html. It's also the standard
way that Clips COOL works, which is the Clips OO module. Although that's
partly a side effect of the triple representation of properties used in
COOL, and the modifications are triple based. I don't know what
mechanism Jess is using to enable this.
Mark
_______________________________________________
rules-dev mailing list
rules-dev(a)lists.jboss.org<mailto:rules-dev@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-dev
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)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
**************************************************************************************
12 years, 8 months
Valid or not valid: 1 < foo < 10?
by Wolfgang Laun
Developers:
it would be *very nice* to have a clarifying statement as to whether
the triplex relational expression is valid or not, so that a proper
issue might be raised.
Status in 5.3.0: accepted by the DRL parser and resulting in unknown semantics.
Thanks
Wolfgang
---------- Forwarded message ----------
From: "Welsh, Armand" <AWelsh(a)statestreet.com>
Date: Mon, 6 Feb 2012 23:18:08 +0000
Subject: Re: [rules-users] How to write rules in two fact's fields?
To: Rules Users List <rules-users(a)lists.jboss.org>
The Drools documentation states that the left side of any binding
pattern of any conditional element must be a read-only property of the
element (or nested property). As such you must rewrite your rule.
Try this:
rule "rule_Name"
when
per: Person(age >= 50 && < 100, income >= 10000 && < 50000,
occupation == "Business", category == "Military", location ==
"Bangalore", custype == "Individual")
pri: Price((price >= 20 && < 30) || price == 1)
then
System.out.println("Success");
end
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of shanmuga
Sent: Sunday, February 05, 2012 3:33 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] How to write rules in two fact's fields?
Hi,
I want to know, how to write rules in two fact's fields?
I used two facts, it will take AND condition or OR condition in between the
two facts.
Please check my code....
package Project
import com.sample.Person;
import com.sample.Price;
rule "rule_Name"
when
per:*Person*(50 <= age < 100, 10000 <= income < 50000, occupation
== "Business", category == "Military", location == "Bangalore", custype ==
"Individual")
pri:*Price*((20 <= price < 30) || price == 1)
then
System.out.println("Success");
end
The both fact values are satisfy means, what is the output?
I got output, even the *Price* fact's value is wrong. (price == 100)
Please slove my problem........!!!!
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-write-rules-in-two-fact-s-fields...
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
12 years, 8 months
'#' deprecated
by Wolfgang Laun
(Why this sudden return to orthogonality?)
Expert still shows the diagram for "comment" with a '#' as the first choice:
images/Chapter-Rule_Language/single_line_comment.png
Also, the warning contains a typo:
<para>Drools also suppors for backward compatibility
s/suppors/supports/
Other chapters in "Expert" still use '#' throughout and in preference of '//'.
-W
12 years, 8 months
Re: [rules-dev] [rules-users] How to write rules in two fact's fields?
by Wolfgang Laun
In most programming languages the result of (e.g.) an integer comparison
20 <= price
is a value of a different type, i.e., boolean, with values "true" or
"false". (You have heard this at some time, right?) Consequently, the
comparison of a boolean with an integer
true < 30
depends on whether the language tolerates it, and if so,
how that result is defined.
IT IS A BUG THAT DROOLS TOLERATES (BUT DOES NOT DEFINE)
SUCH "MULTIPLE" COMPARISONS BUT DOES NOT FLAG THEM AS AN ERROR
OR IMPLEMENT THEM IN SOME WAY. (Tested with 5.3.0 Final.)
This means that you'll have to rwrite your constraints using && or ||,
as appropriate.
-W
On 05/02/2012, shanmuga <shanmugasundaram.t.v(a)gmail.com> wrote:
> Hi,
> I want to know, how to write rules in two fact's fields?
>
> I used two facts, it will take AND condition or OR condition in between the
> two facts.
>
> Please check my code....
>
> package Project
> import com.sample.Person;
> import com.sample.Price;
>
> rule "rule_Name"
> when
> per:*Person*(50 <= age < 100, 10000 <= income < 50000, occupation
> == "Business", category == "Military", location == "Bangalore", custype ==
> "Individual")
> pri:*Price*((20 <= price < 30) || price == 1)
> then
> System.out.println("Success");
> end
>
>
> The both fact values are satisfy means, what is the output?
>
> I got output, even the *Price* fact's value is wrong. (price == 100)
>
> Please slove my problem........!!!!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-write-rules-in-two-fact-s-fields...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
12 years, 8 months
Re: [rules-dev] [rules-users] Contributing to Drools?
by Mark Proctor
I've tried to organise these before, last time I had one person turn up :)
I live in London and Michael Anstis is near by. Mauricio Salatino will
be moving near by in March too. If there are people who are genuinely
interested in learning to hack/improve Drools&jBPM&Guvnor, and not just
after free consultancy, we can arrange days and evenings in London. The
Red Hat office is on Baker Street and has a room suitable for about 8
people.
I live in Chiswick and will gladly meet up with anyone at any time
there, night or day. I regularly work from nero's of starbucks :)
Also remember the entire Drools&jBPM&Guvnor team is always available on irc.
http://www.jboss.org/drools/irc
Mark
On 03/02/2012 15:49, Stephen Masters wrote:
> Hi folks,
>
> As with Mark's response on OSGI this morning, there have been a number
> of answers to questions on this list that mention that components are
> either not currently being worked on, or which request that users
> contribute new features or patches.
>
> It tends not to be that easy to get to grips with a large open source
> project, so recently the London Java Community organised an OpenJDK
> hack session
> (http://www.meetup.com/Londonjavacommunity/events/49243872/) where
> they were helping people to build the projects and working on some
> 'low-hanging-fruit' issues. And apparently the session produced around
> 20 patches, which seems pretty impressive to me given that it was just
> a 3-hour evening session.
>
> There seems to be a reasonable number of Drools developers and users
> in or near London, although I'm not sure about other locations. So I
> was wondering how feasible it might be to organise something similar
> around Drools. Obviously it would need a combination of some core
> developers prepared to spend some of their time helping folks such as
> myself get to grips with building and testing things, and enough
> developers interested in spending their spare time learning their way
> around the internals of the various Drools components. The London
> JBoss User Group set up a JBoss AS7 hackathon last year, so perhaps
> there might be someone there who would be prepared to help out?
>
> Any thoughts?
>
> Steve
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
12 years, 8 months
It looks like maven build is broken for drools-compiler
by Alexander Filipchik
I tried to install drools-compiler 5.3.1.Final in a OSGI container and got
exception -
Error executing command: Unresolved constraint in bundle
org.drools.compiler [171]: Unable to resolve 171.0: missing requirement
[171.0] module;
(&(bundle-symbolic-name=org.drools.core)(bundle-version>=5.3.1.SNAPSHOT)).
I guess it should depend on 5.3.1.Final, not SNAPSHOT
Alex
12 years, 8 months
Looking at http://www.jboss.org/drools
by Wolfgang Laun
At the end of the box with the title "From the Drools & jBPM blog"
there's a funny accumulation of "Category: ...", with lots of
interesting buzz-words.
Highlight: "Category: salaboy".
Cheers
-W
12 years, 8 months