project idea: Debug helper
by Mark Proctor
Have a great project for any intrepid rule exlorers. The project itself
is not too difficult and will make it really easy for people to get an
idea for what is going on inside of the engine. The below is an early
concept idea sketched out, don't take it as a spec to be rigidly
followed :) You know where to find us if you want mentoring on this task:
http://www.jboss.org/drools/irc
While the rule itself is named, patterns are not. By allowing patterns
themselves to take on ids, we can specify capture points. This is
already possible for rule terminal nodes via listeners for rule
activation, but users would still need to write their own handlers. The
proposal here is to write a utility that will capture propagations
during a given start/stop period that users can later inspect for both
activations and join attempts. This will allow users to know exactly
what is happening underneath.
Blow shows a rule with 3 potential capture points:
package pkg1
rule r1 when then
Person( name == "xxx" ) @id(p1)
Location( name == "xxx" ) @id(l1)
then
end
1) The terminal node, via the rule name.
2) p1
2) l1
The idea is to be able to turn on monitor, that has a start(), stop()
and clear() methods. When started it will capture the insert, update,
retract propagations. Further it should be possible to write assertion
utility to assert on the state of the captured information.
When capture is turned on for a given capture point it will record a
List of instances. As different nodes have different data, there is a
base node and a child node. Every time a propagation happens an instance
is created and added to the montior representing the current state.
BaseCapture
NodeType nodeType // enum for join, exists, not etc to allow
for casting to correct node
String nodeName // enum for join, exists, not etc
Collection<Rule> rules // Rules is a collection, as the node
might be shared
Activation activation // Activation at the root of the WM
operation (may be null, if the acion came from outside of the wm).
FactHandle[] f // fact at the root of the working
memory operation
FactHandle[] fh // fact[] that entered the node
JoinCaptire extends BaseCapture
Direction direction // Left/Right enum
FactHandle[] successJoins // the opposite fact handles that were
successfully joined with, during this montioring session
FactHandle[] failedJoins // the opposite fact handles that were
unsuccessfully joined with, during this monitoring session.
//Note if the
propagation was from the left the join arrays will all be an length of 1.
RulePropagation extends BasePropagation
RuleStatus status // Matched, UnMatched, Fired
For example lets say I want to monitor the propagations on l1 and r1,
that happens during two working memory actions. I can do the following:
ksession.insert( new Person("darth"));
fh = ksession.insert( new Location("death star));
NodeMonitor l1monitor = ksession.getMonitor("pkg1/r1/l1")
NodeMonitor r1monitor = ksession.getMonitor("pkg1/r1")
l1monitor.start();
r1monitor.start();
ksession.insert( new Person("yoda));
ksession.retract( fh );
l2monitor.start();
r2monitor.start();
List<JoinCapture> props = l1monitor.getResults(JoinCapture.class);
List<RuleCapture> props = r1monitor.getResults(RuleCapture.class);
l1monitor will show left propagation for yoda and a successful join for
death star
r1 will have two entries. It will show a match (activation creation) but
it will also show an unmatch, due to the retract.
12 years, 11 months
Window Declaration feature merged into master branch
by Edson Tirelli
All,
Just FYI, I just merged the window declaration feature into the master
branch. I will write a proper blog post later about the feature itself, but
be aware that it has a side-effect of breaking the current serialization of
any kbase/ksession that uses sliding windows until we re-implement the
serialization framework in a couple weeks.
Serialization of kbases/ksessions that don't use sliding windows should
not be affected.
Edson
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
12 years, 11 months
Fine Grained Property Change Listeners (Slot Specific)
by Mark Proctor
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
12 years, 11 months
Hudson failing tests
by Michael Anstis
Hello,
Just advising (in my Sheriff capacity) that the following tests are
failing;-
*jbpm
*org.jbpm.integrationtests.ProcessTimerTest.testMultipleTimers
*droolsjbpm-integration
- Geoffrey IIRC you are looking at these?*
org.drools.runtime.pipeline.impl.JSonBatchExecutionTest.testInsertElements
org.drools.runtime.pipeline.impl.JSonBatchExecutionTest.testInsertElementsWithReturnObjects
org.drools.runtime.pipeline.impl.JSonBatchExecutionTest.testSetGlobal
org.drools.runtime.pipeline.impl.JSonBatchExecutionTest.testManualFireAllRules
org.drools.runtime.pipeline.impl.XStreamBatchExecutionTest.testInsertElements
org.drools.runtime.pipeline.impl.XStreamBatchExecutionTest.testInsertElementsWithReturnObjects
org.drools.runtime.pipeline.impl.XStreamBatchExecutionTest.testSetGlobal
org.drools.runtime.pipeline.impl.XStreamBatchExecutionTest.testManualFireAllRules
*guvnor
- Jervis, could you look at the following they all relate to
javax.jcr.nodetype.ConstraintViolationException
*org.drools.guvnor.server.ServiceImplSecurityTest.testCreateNewRule
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetAnalyst
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetPackageReadonly
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetNoCategory
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetNoCategoryPackageAdmin
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetNoCategoryAnalystNegative
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationAssetHasCategory
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationAssetNoCategoryMixed
org.drools.guvnor.server.ServiceImplSecurityTest.testCheckinWithPackageReadonly
org.drools.guvnor.server.ServiceImplSecurityTest.testCheckinPackageDeveloper
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationPackageReadonlyFilter
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationPackageReadonlyMetaDataFilter
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationPackageReadonlyMetaDataFilter2
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetWithRoleBasedAuthrozationPackageReadonlyMetaDataFilter3
org.drools.guvnor.server.ServiceImplSecurityTest.testTableDisplayHandler
org.drools.guvnor.server.ServiceImplSecurityTest.testListPackagesPackageAdminAndAnalyst
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadChildCategories
org.drools.guvnor.server.ServiceImplSecurityTest.testloadRuleListForCategoriesPackageReadonly
org.drools.guvnor.server.ServiceImplSecurityTest.testloadRuleListForCategoriesPackageReadonlyPositive
org.drools.guvnor.server.ServiceImplSecurityTest.testLoadRuleAssetNoCategoryAnalystPositive
*- Toni, Geoffrey,me feel free to look at these :)
*
org.drools.guvnor.server.RepositoryAssetServiceTest.testArchiveAssetWhenParentPackageArchived
org.drools.guvnor.server.RepositoryAssetServiceTest.testAssetSource
org.drools.guvnor.server.RepositoryCategoryServiceTest.testLoadRuleListForCategoriesWithAnalystPermission
org.drools.guvnor.server.RepositoryCategoryServiceTest.testLoadRuleListForCategoriesWithAnalystNoRootCatPermission
org.drools.guvnor.server.RepositoryPackageServiceTest.testPackageBinaryUpdatedResetWhenDeletingAnAsset
org.drools.guvnor.server.RepositoryScenarioTest.testRunScenario
org.drools.guvnor.server.RepositoryScenarioTest.testRunScenarioWithGeneratedBeans
org.drools.guvnor.server.RepositoryScenarioTest.testRunPackageScenariosWithDeclaredFacts
org.drools.guvnor.server.RepositoryScenarioTest.testRunScenarioWithJar
org.drools.guvnor.server.RepositoryScenarioTest.testRunScenarioWithJarThatHasSourceFiles
org.drools.guvnor.server.RepositoryScenarioTest.testRunPackageScenarios
org.drools.guvnor.server.SampleRepositoryTest.testImportSampleRepository
org.drools.guvnor.server.ServiceImplementationTest.testInboxEvents
org.drools.guvnor.server.ServiceImplementationTest.testAddRuleAndListPackages
org.drools.guvnor.server.ServiceImplementationTest.testTrackRecentOpenedChanged
org.drools.guvnor.server.builder.PackageDRLAssemblerTest.testSkipDisabledImports
org.drools.guvnor.server.contenthandler.ModelContentHandlerTest.testModelAttached
org.drools.guvnor.server.contenthandler.ModelContentHandlerTest.testModelRemoved
org.drools.guvnor.server.files.WebDAVImplTest.testCreateResourceAndCreatedDate
org.drools.guvnor.server.jaxrs.BasicPackageResourceTest.testGetPackageForXML
org.drools.guvnor.server.repository.MailboxServiceTest.testMailbox
org.drools.guvnor.server.repository.MailboxServiceTest.testOneToMany
org.drools.guvnor.server.repository.UserInboxTest.testIncoming
org.drools.guvnor.server.security.SecurityServiceImplTest.testLogin
org.drools.guvnor.server.VerificationServiceImplementationTest.testVerifyAsset
With kind regards,
Mike
12 years, 11 months
Drools XML Language and Tools Development
by Justin Holmes
Hello Devs,
My name is Justin Holmes and I'm a Middleware Consultant for Red Hat. I'm currently staffed on an engagement that provides a very interesting use case for Drools. In particular, our teams currently believes that the Drools XML Language would be the best possible solution for one of our problem. We are aware that the Drools XML language has not been developed for sometime and is considered deprecated. Additionally, the application will need to support Drools CEP functionality in the near future. Before we begin crafting a custom solution, we would like to ask:
1) Is the XML language truly the best option for our use case?
2) If it is the best option, how do we begin developing the XML language and tools (XMLPackageReader) to fully support at least BRMS 5.2?
Context:
Client is using Drool 5.1.1 and we are migrating to BRMS 5.2. There are two independent workflows of interest:
1) Rule Authoring and DRL generation: The rule assets and metadata are kept in a custom format (both relational DB and XML) in order to decouple it from the runtime. Thus, the client wrote their own GUI and content manager instead of using Guvnor. The custom GUI allows business users to author 3 types of content, as well as rules for these types of content, using a guided-rule editor with domain specific language. The following steps occur when a user wants to produce a new version of a rule:
i) GUI saves LHS rule logic in an XML database using MathML (http://www.w3.org/Math/), and then saves everything else in a relational database.
ii) iBATIS pulls down the corresponding database and XML entries and populates POJOs. There is 1 class definition per content type.
iii) Cumbersome application code translates POJOs into Drools PackageDescr (~5000 lines of code, not using fluent API). This step produces a very strange and convoluted representation of the LHS of each RuleDescr. It works with DrlDumper 5.1.1 but does not work properly with the BRMS 5.2 version of DrlDumper (MVEL Template). This is the source of our problem.
iv) PackageDescr is dumped into a valid DRL string with Drools DrlDumper
v) Custom content manager does some versioning and then stores DRL in an XML database
2) Deployment and Runtime: App is deployed daily and will have dozens of runtimes during that 24 span. When deployed, it pulls all rules from the database and builds several KnowledgePackages, which are cached, and then used throughout the day.
Proposed Solution:
Because the app code that performs step iii) is so convoluted and will need to be modified in order to support CEP, we want to pursue a more maintainable solution to provide the translation and abandon the mess that is already in the application. We feel that rewriting this code with the fluent API is just as dangerous as the present code. Additionally, the rules are far too variable to use Rule templating.
So, we propose to translate the client's custom rule assets and metadata into the Drools XML Language, parse the XML and dump out DRLs. We will likely need to use the existing intermediate POJOs for this. The most difficult piece in the puzzle by far is translating the LHS of rules, and of course this is the part that is broken currently in our system. We believe that it should be MUCH easier to translate the well formatted MathML representation of the LHS to the Drools XML schema using XSLT, than to translate it to PackageDescrs with Java code. There are also the additional benefits of validation and portability presented by XML. The downside here is that the XML language and tools are out of date, so we would need to develop these solutions first.
Both consultants on this project have been interested in contributing to the Drools project and we feel this could be the perfect entry point. We realize this is a complicated question and presenting it over email is limiting, so please feel free to contact me by phone.
Thank you,
---
Justin Holmes
Red Hat Consulting
410.599.8432 : mobile
http://www.redhat.com/consulting/
12 years, 11 months
Last Chance - Drools & jBPM at ICAART (Portugal) 4th International Conference on Agents and Artificial Intelligence
by Mark Proctor
The event is just one week away from being cancelled if we don't get
more attendance. So if you are thinking of going, better sign up now,
before it's too late.
Mark
---------------
<http://4.bp.blogspot.com/-_b77C8kLxEk/TuDUJkn_TlI/AAAAAAAAAnY/_QPFAuMEdOo...>
Droosl & jBPM @ ICAART 2012 is now confirmed, and myself (Mark Proctor)
and Dr Davide Sottara will be there. If you have any interesting
research on or with Drools & jBPM that you would like to present on the
day, let us konw.
6-8 Febuary 2012
Vilamoura, Algarve, Portugal
http://www.icaart.org/tutorials.asp
The day is a tutorial day aimed at all levels. It will start with
general introductions to the technology but will slant off to more of
our research based projects such as Drools Semantics and Chance, as it's
part of an academic conference. We would also like to give an
opportunity for the people to present their own research, slots can be
anything from 20minutes to 60 - contact me if you are interested
mproctor at codehaus d0t org.
There will also be plenty of time for discussions and help with your own
projects.
*Abstract*
Drools is the leading open source, industry focused, rule engine. While
Drools started life as a Rete based forward chaining engine, it has
since transcended. It's ongoing mission is to explore declarative
paradigms from a practical and industrial perspective, to boldly go
where no engine has gone before.
The tutorial will start with a gentle introduction, suitable for all
level of expertise, covering the core language and functionality slowly
expanding into more complex areas. The topics covered include, but are
not limited to:
Basic Concepts:
* Patterns, Constraints and Unification
* Data Driven and Goal Oriented Inference using Forward Chaining and
(Opportunistic) Backward Chaining
* Truth Maintenance
* Temporal Reasoning and Complex Event Processing
* Functional Programming
* Traits and Declarative Models
Advanced Topics:
* Decision Tables
* Rule and Workflow Integration
* Hybrid Rule-Based Systems
* Agents and Services
* Unified Testing
*Brief biography of Mark Proctor*
Mark Proctor received his B.Eng in Engineer Science and Technology and
then his M.Sc. in Business and Information Systems; both from Brunel
University, West London. His M.Sc. thesis was in the field of Genetic
Algorithms; which is where he discovered his interest for anything AI
related.
Mark became involved in the Drools expert system project at an early
stage and soon became its project lead. Mark then joined JBoss (later
acquired by Red Hat) as an employee when the Drools project was
federated into the JBoss middleware stack.
Mark now leads the effort at Red Hat for a unified platform for
declarative technologies; with a focus on rules, event processing,
workflow, semantics, distributed agents and governance.
*Brief biography of Davide Sottara*
Davide Sottara received his Ms. Degree in Computer Science(2006) and his
Ph.D (2010) in Computer Science, Electronics and Telecommunications from
the University of Bologna.
His research and development interests include Artificial Intelligence
in general and Decision Support Systems in particular, focusing on
hybrid systems combining predictive models and rule-based systems.
Since 2006, he has been working on the development of intelligent DSSs
in the environmental and medical field. He is a member of the Drools
open source Community, leading a sub-project on the extension of
production rule engines to support hybrid and uncertain reasoning, and
he's also involved in the RuleML rule language standardization
initiative. He is currently working on remote health-care systems
enhanced with AI-based predictive, diagnostic and planning features.
*Contacts*
e-mail: icaart.secretariat(a)insticc.org
<mailto:icaart.secretariat@insticc.org>
12 years, 12 months
Drools on android
by Justin King
Hi All,
I'm wondering if anyone has tried to use drools in a google android
application, and if so what problems did you have? I'd also be interested to
know if its even possible!
Thanks!
--
Regards,
Justin King
PhD Candidate
Faculty of Information and Communication Technologies
Swinburne University of Technology
http://www.ict.swin.edu.au/ictstaff/justinking
--
Regards,
Justin King
PhD Candidate
Faculty of Information and Communication Technologies
Swinburne University of Technology
http://www.ict.swin.edu.au/ictstaff/justinking
13 years