Mark,
I'm thinking we can get something simple working with current DROOLS
- and then move to V3 once its stable after that.
Assertions - I'm used to the Prolog approach - where instead of
anonymous facts - you actually assert more than one factor together -
e.g.
assertz(myfact(cheese,english,stilton)),
assertz(myfact(cheese,french,brie)),
assertz(myfact(cheese,english,cheddar)),
and then you would have a rule that evaluates:
myfact(cheese,english,_)
would return two matches.
I'd expect DROOLS to support something similar?
Thanks, DW
-------- Original Message --------
Subject: Re:
Drools and CAM
From: Mark Proctor
<>
Date: Mon, January 02, 2006 1:20
pm
To:
Cc: ,
,
You might want
to take a look at the rule execution part in my
presentation. In
Drools 3.0 we will support Clips/Jess style Agenda
Modules, this
means you can partition your rules, allowing you to
control which
rules can fire and when. For example you might assert data
that
causes validation and process rules to both match, but you don't
want the process rules to fire until all the validation rules are
finished - this can be achieved with Modules.
One of the
more difficult integration areas, as we have discovered with
jBPM,
is that Drools matches fact types, it does not match variable
names. So if you have two Cheese variable instances in your
application,
cheddar and stilton, you cannot map your variable
names in your
application to variable names in the Drools - you
have to instead use
constraints - maybe people have problems
understanding this. The best
way of thinking about this is facts
are always anonymous when they are
asserted into the rule
engine.
Application Data is simply a way to make data available
to
conditions/consequences without it having to be asserted or take
up
space in the WorkingMemory, no changes to application data will
cause
the rule engine to re-evaluate rules.
Other things to
think about are stateful and stateless working memories
and how to
deal with deep object structures.
Hope that helps for
starters.
The downside is Drools 3.0 won't be ready for public
use, in beta form,
until some time in
february.
Mark
wrote:
> Hi,
>
> In JCAM I have built in
a mechanism to have DROOLS perform the DataValidation section of the CAM
Spec. The idea is that by passing in a set of nodes described by
an XPath it would be posible to invoke a script that would then work
with the nodes supplied.
> This is done by describing a Java
Class that allows the nodes to be added to the DROOLS working memory
and allow the consequences to interact with the nodes by changing
values etc.
> It seems to work reasonably well and is very simple
to implement.
>
> I am also toying with the idea of
using the DROOLS ApplicationData construct to allow the rules engine to
be passed the either the template or the xmlfile. This would
enable DROOLS to manipulate the complete tree and possibly transform
the output based on the rules. The other extension would be to
allow the DROOLS to be passed an empty document that it could use to
hang new constructs off based on the rules firing.
>
> One of the questions I have is what rules might be
applied. Without some clear examples it if not easy to know how
to integrate the tool. It seems to me that DROOLS could be used
in two parts of the CAM template - DataValidations and External
Mappings.
>
> One further thing I am investigating
for jCAM is the use of PicoContainer as a method to allow the other
processors to be included into the processor. The idea being that
for each section of the CAM template a processor would be passed three
possible things - the XML file being processed, the Assembly Structure
after the Business Rules hade been applied and the section of the CAM
template the applied to the processor being plugin. The advantage
of this method is that we can get the whole of the CAM Spec done by
different people yet all work with the same tool. It also means
that somebody can change the default processor with another without
affecting the other bits. For example if I get the split right we
should be able to allow schema based includes without disrupting the
rest of the tool.
>
> Happy New Year
>
> Martin
>
>
________________________________
>
> From: Mark Proctor
[mailto:]
> Sent: Mon 02/01/2006
05:46
> To: David RR Webber (XML)
> Cc:
; CAM TC; Roberts,MME,Martin,XBX R
>
Subject: Re: Drools and CAM
>
>
> Sure no problem, we
are always there - just letting you know, in case you need any help with
Drools.
>
> Mark
> David RR Webber (XML) wrote:
>
> Mark,
>
> We'll see who it goes. My
time is extremely short this week - will attend to the PPT first.
Maybe some of the other folks on the list may want to hop over
for a chat....
>
> Thanks, DW
>
>
>
>
> -------- Original Message --------
>
Subject: Re: Drools and CAM
> From: Mark Proctor
<> <mailto:>
> Date: Sun, January 01, 2006 10:38 pm
> To: "David Webber
(XML)" <> <mailto:>
>
Cc: , CAM TC <>
<mailto:> , Martin
> Roberts
<>
<mailto:>
>
> IRC isn't a
list it's a live chat room where you can talk to me and the other
developers - no need to subscribe, just pop in and have a chat
:)
>
> Mark
> David Webber (XML) wrote:
>
> Mark,
>
> Your PPT is a great
introduction to the world of rule engines and
> methods.
>
> My own background is heavily Prolog - for 15 years. I
missed seeing
> constraint based solutioning - but I guess DROOLS
has to leave
> somethings to
> those old purpose built
engines! And besides DROOLS could always
> collaborate with
a Prolog engine as a close cousin.... ; -)
>
> On to CAM
and DROOLS. I have some PPT slides I will share during
the
> week
> once I've cleaned them up for external
perusal.
>
> Basically the notion is to use the mechanisms
in CAM - that is
> essentially a
> domain expert agent in
XML structures and metadata - and provide an
> interface directly
in CAM to DROOLS and back again. Then we're adding
>
the
> ability to persist to SQL databases in CAM directly from
the XML source
> -
> using simple XML syntax based
assignment instructions.
>
> This should allow people who
are not DROOLS experts - to create a
> business-centric solution
that quickly handles basic ebusiness
> transactions - while
allowing extended rules to be layered into this -
> by
>
software staff - that handle decreet rules and tests that are beyond
the
> scope of the base CAM function set.
>
> This
gives people the best of both worlds - a purpose built business
XML
> expert agent - coupled to the extensible DROOLS
engine.
>
> Your snippet of DROOLS V3 shows that this is
all heading in the right
> direction.
>
> We've been
experimenting with:
> <as:includeScript
location="{url/my.drl}"/>
> and
> <as:executeScript
name="{name.drl}" parm="\\xpath\locator\*"/>
>
> as a
first pass to provide linkage between the two.
>
> I am
definately interested in discussing this with the DROOLS
community
> -
> where CAM can provide a pluggable XML
handler toolkit for DROOLS users?
>
> Beyond all this -
DROOLS also looks like a good means to implement a
>
state
> machine for BPSS (and JBOSS driven BPM) as envisioned in
our BCM
> architecture work - but we'll solve one problem at a
time here!
>
> I'm a bit allergic to signing up for IRC
lists - my daily bandwidth is
> severally constrained already -
but we can definately look at sharing
> some
>
collaboration resources - possibly a wiki area - where ideas and
test
> components can be posted..?
>
> Thanks,
DW
>
> ----- Original Message -----
> From: "Mark
Proctor" <>
<mailto:>
> To:
<> <mailto:> ;
<> <mailto:>
> Sent: Sunday, January 01, 2006 2:24 PM
> Subject: Drools
and CAM
>
>
>
>
> David,
Tanveer,
>
> GoogleAlert brought your postings to my
attention. We have big plans for
> Drools 3.0, which will be
available at the end of Q1 - see the slides at
>
>
>
>
http://drools.org/download/attachments/20545/Business+Rules+Engines.ppt?version=1
>
>
> for more details.
>
> In the mean
time if there is anything more we can do to assist or you
> just
want a general chat, we are always on the irc server #drools at
>
irc.codehaus.org - we provide a web gateway at http://irc.codehaus.org
<http://irc.codehaus.org/>
> if you do not want to install
an IRC client.
>
> Mark
>
>
>
>
>
>
>
>
>
>
>