Wednesday, July 23, 2008
Tuesday, July 22, 2008
GuvnorNG
Work has already begun on GuvnorNG, which is the next generation web framework for Drools, which will hopefully be delivered next year. GuvnorNG is being written to provide the foundations for the JBoss SOA Platform governance tooling, so we need to make every aspect of it pluggable. So it'll have pluggable viewers and editors, be more flexible on the content types it can store and support dashboard layouts. Mike Brock, the MVELauthor, is the main person behind this at the moment. It's very early stages and Mike is working on the foundations, particularly state management and pluggability. He has made a screen caste so people can see it working, notice at the end how the refresh does not lose any state. You can find the Screencast here.
As always Mike is looking for contributors, it's a very interesting project that can be usable standalone, outside of Drools, for any enterprise to develop their governance software and dashboards with.
Saturday, July 19, 2008
Rolodex Panel Assembly for Guvnor (Anton Arhipov)
In my previous post about integrating rolodex into Guvnor I tried to create the example just with a set of pre-compiled images which are then assembled into drools-guvnor.war. But the real goal is actually to display the pictures stored in Jackrabbit repository for Guvnor.
Now, after some experiments with rolodex and Guvnor, I have a widget where one may upload a picture and display it.
Currently it can accept only one picture per RuleAsset class instance. Therefore the content handler for this asset should be extended to support multiple images per RuleAsset.
RolodexCardBundle images = getImagesFromAsset();I have set the hight of the panel manually as the picture was cropped otherwise in the widget. (Don't know the reason yet). getImagesFromAsset() is used for converting the asset's content to the RolodexCard:
RolodexCard[] rolodexCards = images.getRolodexCards();
if (rolodexCards.length > 0) {
final RolodexPanel rolodex =
new RolodexPanel(images, 3, rolodexCards[0], true);
layout.addRow(rolodex);
}
public RolodexCardBundle getImagesFromAsset() {
return new RolodexCardBundle() {
ClippedImagePrototype clip = new ClippedImagePrototype(
GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID
+ "=" + asset.uuid, 0, 0, 300, 200 );
RolodexCard card = new RolodexCard(clip, clip, clip, 300, 100, 10);
public int getMaxHeight() {
return 200;
}
public RolodexCard[] getRolodexCards() {
return new RolodexCard[]{card};
}
};
}I've cheated with the code that composes the RolodexCard, as ClippedImagePrototype's javadoc says:This class is used internally by the image bundle generator and is not intended for general use. It is subject to change without warning.But the implementation of ClippedImagePrototype is actually what I need. Probably, if it is really the subject to change at any time, I would rather cope'n'paste this class into Guvnor code base.
TODO:
A heavy part of the work will have to be carried out by the content handler. The content handler will have to support the multiple images per asset and also perform some graphics routines in order to replace the pre-compilation phase implemented in rolodex to adjust images.
Friday, July 18, 2008
Guvnor BRMS and Eclipse Synchronisation
The Guvnor (BRMS) and Eclipse synchronisation tool has made leaps and bounds in progress for the upcoming 5.0 Milestone 2 release. It now has full bi-direction synchronisation of files between Eclipse and Guvnor. A developer can now work locally with a rule, or other Guvnor assets, they can do lots of small commits to their SCM of choice and when they need to can upload or synchronise that asset with Guvnor. Eclipe diff viewing is also supported.
Tuesday, July 15, 2008
Integrating Rolodex to Guvnor for Image Asset Types
In Guvnor, there are many different widgets that are used to display or edit different assets. One interesting widget is about to be added - a widget that could accept images and display them. For this purpose, rolodex, a widget that can display a stack of images, can be used. Rolodex uses deferred binding for the image generation and animation. Let's see how can we quickly add a new widget displaying some predefined images.
First, create a class, implementing RolodexCardBundle interface (from the rolodex library) and declare a few methods that will return the images (just like ImageBundle described in the book):
public abstract class Images implements RolodexCardBundle {
/**
* @gwt.resource img_3861.jpg
*/
public abstract RolodexCard imgA();
/**
* @gwt.resource img_3863.jpg
*/
public abstract RolodexCard imgB();
/**
* @gwt.resource img_3865.jpg
*/
public abstract RolodexCard imgC();
...
private final RolodexCard[] cards = new RolodexCard[]{ imgA(), imgB(), imgC() };
public RolodexCard[] getRolodexCards() {
return cards;
}
}Next, to display those images, create ImageSetWidget (or you-name-it) class extending DirtyableComposite:public class ImageSetEditor extends DirtyableComposite {
// asset and viewer are not used now...
public ImageSetEditor(RuleAsset asset, RuleViewer viewer) {
final Images images = (Images) GWT.create(Images.class);
final RolodexPanel rolodex
= new RolodexPanel(images, 3, images.imgA(), true);
initWidget(rolodex);
}
}
For Guvnor to be able to launch the editor, we have to modify EditorLauncher class:...AssetFormats should be supplied with the new constant for this new type, of course.
else if (asset.metaData.format.equals(AssetFormats.IMAGE_SET)) {
return new ImageSetEditor(asset, viewer);
...
To allow user to create such widgets in UI, a new menu item needs to be added.

This means, ExplorerLayoutManger#rulesNewMenu() should be modified
m.addItem(new Item("New ImageSet",
new BaseItemListenerAdapter() {
public void onClick(BaseItem item, EventObject e) {
launchWizard(AssetFormats.IMAGE_SET, "New ImageSet", true);
}
}, "images/rule_asset.gif"));And last, but not least we need to include the following line in Guvnor.gwt.xml
<inherits name='com.yesmail.gwt.rolodex.Rolodex'/>Now, after the project has been rebuilt and redeployed we get the following widget on the screen:

Currenly, the widget is displaying a predefined set of images and animates them as we roll the mouse over. So we have now a rolodex-powered widget inside Guvnor. Sounds cool! :)
Now, there are a lot of TODOs to make use of this new cool widget.
- Menus should be pluggable. So far I knew that the only class that we should generate in order to support adding new rule editor widgets. Without doubt, a user needs a button to create the widget in his workspace, and therefor we should inject the new menu item. I suppose we can generate this part also. Therefore we need to extract the ExplorerLayoutManger#rulesNewMenu() method into a separate class.
Currently I have an ant task ready to generate a new EditorLauncher class source to plug a new asset type editor. But perhaps, if we have more of these classes to be generated, I'd better add a new ruby script to do this job. - Upload of new images. There's no use of this widget if it can redisplay only the predefined set of images.

- RuleAsset support for images.The images should be supplied via the RuleAsset, i.e. the content should be a class that could represent a set of images.
- A content handler is required as well.
Wednesday, July 09, 2008
Drools and WordNet
Someone has made a working implementation of WordNet for Drools and posted it to the user mailing list, andI thought others might find it interesting so I've blogged it here. The link below is for the email and contains the paste code.
http://www.mail-archive.com/rules-users@lists.jboss.org/msg05918.html
http://en.wikipedia.org/wiki/WordNet
WordNet is a semantic lexicon for the English language. It groups English words into sets of synonyms called synsets, provides short, general definitions, and records the various semantic relations between these synonym sets. The purpose is twofold: to produce a combination of dictionary and thesaurus that is more intuitively usable, and to support automatic text analysis and artificial intelligence applications. The database and software tools have been released under a BSD style license and can be downloaded and used freely. The database can also be browsed online.
Drools Scalability
We often get asked about Drools scalability in complex apps, so I thought I would link to this posting just done, where someone has Drools scaling to 900K facts on a 64bit JVM with reasonable performance.
http://www.mail-archive.com/rules-users@lists.jboss.org/msg05922.html
at
3:20 PM
0
comments
Links to this post
Labels: Drools, Performance
Saturday, July 05, 2008
Drools Smooks Data Loader
Smooks is a powerful open source ETL tool, it can transform variety of data sources. 
Drools now supports an internal model, so ideally you want to be able to load different payloads, such as XML, into this model. I've just added support for this and it'll be in M2 :)
Here is an example of the api loading an XML file into a drools session, the xml entries for OrderItem are mapped into the internal class and inserted into the given session. The matching rules simple do a print statement.
declare OrderItem
productId : long
quantity : Integer
price : double
end
rule someRule
when
$i : OrderItem()
then
System.out.println( $i );
end
PackageBuilder pkgBuilder = new PackageBuilder();
pkgBuilder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test.drl" )) );
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkgBuilder.getPackage() );
StatefulSession session = ruleBase.newStatefulSession();
// Instantiate Smooks with the config...
Smooks smooks = new Smooks( "smooks-config.xml" );
// set rood id
DroolsSmooksConfiguration conf = new DroolsSmooksConfiguration( "root" );
DroolsSmooks loader = new DroolsSmooks( session, smooks, conf );
loader.insertFilter( new StreamSource( new ByteArrayInputStream( readInputMessage() ) ) );
session.fireAllRules();
Friday, July 04, 2008
The Rise of the Open Source BRMS
The JavaRules blog has done an interesting take on the rise of the Open Source BRMS, titled "Drools, BRMS and Revolutions".
Here is a choice quote:
"Here’s another thing: More and more companies are using shareware or freeware products such as Linux, Open Office, Java, Eclipse, Net Beans, JBoss to run those $500K (final installed price) BRMS packages. Now they’re going to have another really good package to add in there; Drools. The line between commercial BRMS vendors and freeware vendors is becoming more and more blurred and, with the next year or two, should disappear altogether."
at
8:32 PM
0
comments
Links to this post
Labels: Drools
Drools 5.0 M1 - New and Noteworthy
Drools 5.0 will split up into 4 main sub projects, the documentation has already been split to reflect this:
- Drools Guvnor (BRMS/BPMS)
- Drools Expert (rule engine),
- Drools Flow (process/workflow)
- Drools Fusion (cep/temporal reasoning)
M2 will involve an API change as we refactor away from being rules centric, as discussed here, we will provide a legacy 4.0 wrapper jar for backwards compatability in some later milestones.
We hope that M3/M4 will start to be more user/public friendly as the feature set matures and bugs come in and we start to update the documentation. We are hoping for an August/Sept release.
5.0 M1 can be found on the main drools download page. The Binary with dependencies is particularly large, but the bulk of it is uml javadocs, we will try and address this in M2 or M3 where we will try and remove non public stable apis.
A Big Thanks to the following Contributors
Ming Jin - Package serialisation performance increase (10x improvement)
Steven Williams - various decision table tasks.
Guvnor (the BRMS component)
New look web toolingWeb based decision table editor
Integrated scenario testing

WebDAV file based interface to repository

Declarative modelling of types (types that are not in pojos)

This works with the new "declare" statement - you can now declare types in drl itself. You can then populate these without using a pojo (if you like). These types are then available in the rulebase.
Others:
- Logic verifier
- Improvements to guided editor (many)
CORE ENGINE
Asymmetrical Rete algorithm implementationShadow proxies are no longer needed. Shadow proxies protected the engine from information change on facts, which if occurred outside of the engine's control it could not be modified or retracted.
PackageBuilder can now build multiple namespaces
You no longer need to confine one PackageBuilder to one package namespace. Just keeping adding your DRLs for any namespace and getPackages() returns an array of Packages for each of the used namespaces.
Package[] packages = pkgBuilder.getPackages();
RuleBase attachment to PackageBuilder
It is now possible to attach a RuleBase to a PackageBuilder, this means that rules are built and added to the rulebase at the same time. PackageBuilder uses the Package instances of the actual RuleBase as it's source, removing the need for additional Package creation and merging that happens in the existing approach.
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilder pkgBuilder = new PackageBuilder( ruleBase, null );
Binary marshalling of stateful sessions
Stateful sessions can now saved and resumed at a later date.
Pre-loaded data sessions can now be created.
Pluggable strategies can be used for user object persistence, i.e. hibernate or identity maps.
Type Declaration
Drools now supports a new base construct called Type Declaration. This construct fulfils two purposes: the ability to declare fact metadata, and the ability to dynamically generate new fact types local to the rule engine. The Guvnor modelling tool uses this underneath.
One example of the construct is:
declare StockTick
@role( event )
@timestamp( timestampAttr )
companySymbol : String
stockPrice : double
timestampAttr : long
end
Declaring Fact Metadata
To declare and associate fact metadata, just use the @ symbol for each metadata ID you want to declare. Example:
declare StockTick
@role( event )
end
Triggering Bean Generation
To activate the dynamic bean generation, just add fields and types to your type declaration:
declare Person
name : String
age : int
end
DSL improvements
A series of DSL improvements were implemented, including a completely new parser and the ability to declare matching masks for matching variables. For instance, one can constrain a phone number field to a 2-digit country code + 3-digit area code + 8-digit phone number, all connected by a "-" (dash), by declaring the DSL map like:
The phone number is {number:\d{2}-\d{3}-\d{8}}
Any valid java regexp may be used in the variable mask.
Complex Event Processing Support (Temporal Reasoning)
Drools 5.0 brings to the rules world the full power of events processing by supporting a number of CEP features as well as supporting events as first class citizens in the rules engine.Event Semantics
Events are (from a rules engine perspective) a special type of fact that has a few special characteristics:
- they are immutable
- they have strong time-related relationships
- they may have clear lifecycle windows
- they may be transparently garbage collected after it's lifecycle window expires
- they may be time-constrained
- they may be included in sliding windows for reasoning
Event Declaration
Any fact type can assume an event role, and its corresponding event semantics, by simply declaring the metadata for it. Both existing and generated beans support event semantics:
# existing bean assuming an event role
import org.drools.test.StockTick
declare StockTick
@role( event )
end
# generated bean assuming an event roleEntry-Point Stream Listeners
declare Alarm
@role( event )
type : String
timestamp : long
end
A new key "from entry-point" has been added to allow a pattern in a rule to listen on a stream, which avoids the overhead of having to insert the object into the working memory where it is potentially reasoned over by all rules.
$st : StockTick( company == "ACME", price > 10 ) from entry-point "stock stream"To insert facts into an entry point:
WorkingMemoryEntryPoint entry = wm.getWorkingMemoryEntryPoint( "stock stream" );StreamTest shows a unit for this.
entry.insert( ticker );
Event Correlation and New Operators
Event correlation and time based constraint support are requirements of event processing, and are completely supported by Drools 5.0. The new, out of the box, time constraint operators can be seen in these test case rules:
test_CEP_TimeRelationalOperators.drl
As seen in the test above, Drools supports both: primitive events, that are point in time occurrences with no duration, and compound events, that are events with distinct start and end timestamps.
The complete list of operators are:
- coincides
- before
- after
- meets
- metby
- overlaps
- overlappedby
- during
- includes
- starts
- startedby
- finishes
- finishedby
Drools 5.0 adds support for reasoning over sliding windows of events. For instance:
StockTick( symbol == "RHAT" ) over window:time( 60 )The above example will only pattern match the RHAT stock ticks that happened in the last 60 clock ticks, discarding any event older than that.
Session Clock
Enabling full event processing capabilities requires the ability to configure and interact with a session clock. Drools adds support for time reasoning and session clock configuration, allowing it to not only run real time event processing but also simulations, what-if scenarios and post-processing audit by replaying a scenario.
The Clock is specified as part of the SessionConfiguration, a new class that is optionally specified at session creation time:
SessionConfiguration conf = new SessionConfiguration();
conf.setClockType( ClockType.PSEUDO_CLOCK );
StatefulSession session = ruleBase.newStatefulSession( conf );
Drools Flow
Drools 4.0 had simple "RuleFlow" which was for orchestrating rules. Drools 5.0 introduces a powerful (extensible) workflow engine. It allows users to specify their business logic using both rules and processes (where powerful interaction between processes and rules is possible) and offers a unified enviroment.Interactive Debugger
Process Instance view at a specific breakpoint:
Current active nodes in a workflow in a specific breakpoint:
New NodesTimers:
A timer node can be added which causes the execution of the node to wait for a specific period. Currently just uses JDK defaults of initial delay and repeat delay, more complex timers will be available in further milestones.
Human Task:
Processes can include tasks that need to be executed by human actors. Human tasks include parameters like taskname, priority, description, actorId, etc. The process engine can easily be integrated with existing human task component (like for example a WS-HumanTask implementation) using our pluggable work items (see below). Swimlanes and assignment rules are also supported.
The palette in the screenshot shows the two new components, and the workflow itself shows the human task in use. It also shows two "work items" which is explained in the next section:

Domain Specific Work Items
Domain Specific Work Items are pluggable nodes that users create to facilitate custom task execution. They provide an api to specify a new icon in the palette and gui editor for the tasks properties, if no editor gui is supplied then it defaults to a text based key value pair form. The api then allows execution behaviour for these work items to be specified. By default the Email and Log work items are provided. The Drools flow Manual has been updated on how to implement these.
The below image shows three different work items in use in a workflow, "Blood Pressure", "BP Medication", "Notify GP":
This one ows a new "Notificatoin" work item:
extensible Process Definition Language (ePDL)
Drools 4.0 used Xstream to store it's content, which was not easily human writeable. Drools 5.0 introduced the ePDL which is a XML specific to our process language, it also allows for domain specific extensions which has been talked about in detail in this blog posting "Drools Extensible Process Definition Language (ePDL) and the Semantic Module Framework (SMF)". An example of the XML language, with a DSL extension in red, is shown below.
<process name="process name" id="process name" package-name="org.domain"
xmlns="http://drools.org/drools-4.0/process"
xmlns:mydsl="http://domain/org/mydsl"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-4.0/process drools-processes-4.0.xsd" >
<nodes>
<start id="0" />
<action id="1" dialect="java">
list.add( "action node was here" );
</action>
<mydsl:logger id="2" type="warn">
This is my message
<mydsl:logger>
<end id="3" />
</nodes>
<connections>
<connection from="0 to="1" />
<connection from="1" to="2" />
<connection from="2" to="3" />
</connections>
</process>
Pluggable Nodes
The underlying nodes for the framework are completely pluggable making it simple to extend and to implement other execution models. We already have a partial implementation for OSWorkflow and are working with Deigo to complete this to provide a migration path for OSWorkflow users.
Other enhancements include exception scopes, the ability to include on-entry and on-exit actions on various node types, integration with our binary persistence mechanism to persist the state of long running processes, etc. Check out the Drools Flow documentation to learn more.
Drools Clips
A very alpha quality version of Drools Clips is now working and supports:- deftemplate
- defrule
- deffuction
- and/or/not/exists/test Conditional Elements
- Literal, Variable, Return Value and Predicate field constraints

The screen shot is a contrived example but it does show a shell environment cleanly mixing deftemplates and pojos - note that Drools 5.0 does not require shadow facts, due to the new asymmetrical Rete algorithm. It also shows deffunction in use.
Wednesday, July 02, 2008
Texas October Rules Fest and Drools Team Meeting
The Texas Rules User Group is organising a 3 day conference for Expert Systems starting October the 22nd - the October Rules Fest (ORF) . It's a non-profit event costing only $150 for the three days. This is a "No Fluff, Just Stuff" conference and the idea is to keep it technical so people can actually learn. The sessions are listed here, the speakers bios here and the agenda here. The sessions and speakers are still fluid at the moment, but I've been sent a more up to date version, which I've pasted at the end of this blog. There is also a promotion PDF here. I know the organisers are still searching for sponsors, to help justify the low cost for the event, so if you can help please do.
The Drools team will arrive a week earlier on the 15th of October and will be doing a 7 day team meeting at the Best Western Hotel. This meeting is open to the public, so if you want some hard core hands on coding do try and come down and join in with the coding fest :) This is a great opportunity to learn Drools at an indepth level and contribute back to the project, we can also assist helping you to solve any Drools extensions you are doing for your job - a great opportunity for you to get your managers time and budget approval :) The Best Western is currently only $89 per night, so very affordable.
The current tentative agenda for ORF is pasted below:
| Wednesday AM | Tutorials | ||||
| 8:00 - 8:15 | Pete Carapetyn | Data Fundamentals | Welcome | ||
| 8:15 - 9:15 | Dr. Kappleman | North Texas Univ. | Rules: Essential But Only Part of the Puzzle | ||
| 9:30 - 10:20 | Rolando Hernandez | BizRules.Com | Introduction to Business Rules Architecture and Rulebase Technology | ||
| 10:30 - 11:20 | Larry Terril | EBDX | Declarative vs Procedural Programming | ||
| 11:30 - 12:30 | Greg Barton | Greg Stuff | Introduction to Evolvable Rules | ||
| 12:30 - 2:00 | Lunch | ||||
| Wednesday PM | Conference Begins | ||||
| 2:00 - 3:15 | Jason Morris | Morris Technical Solutions (Jess) | The Ontology of Rulebased Systems | ||
| 3:30 - 4:45 | Edson Tirelli | Drools | CEP - Complex Event Procesing Based on Rete | ||
| 5:00 - 6:15 | Michael Neale | Drools | "Guvnor" - A BRMS for Drools and Managing Other Asset Types | ||
| 6:15 - 8:00 | Pub Night 1 | ?? | |||
| Thursday AM | Vendor's Day | ||||
| 8:00 - 9:00 | Dr. Levine | Unit Texas Arlington | Keynote 2: Brain mechanisms for Making, Breaking and Changing Rules | ||
| 9:00 - 10:00 | Art Torteloro | Visual Rules | Constraints and Integration of Methodology With Automation | ||
| 10:15 - 11:15 | Carlos Seranno-Morales and Carole Ann Berliotz-Matignon | Fair Isaac | TBD | ||
| 11:30 - 12:30 | Dr. Feldman | Open Rules | Using Constraing Programming in Business Rules Environment | ||
| 12:30 - 2:00 | Lunch | ||||
| Thursday PM | |||||
| 2:00 - 3:15 | ?? | Informavores | TBD | ||
| 3:30 - 4:45 | ?? | Haley Systems | TBD | ||
| 5:00 - 6:15 | Daniel Selman | ILOG | Sequential Rules and Their Applications | ||
| 6:15 - 8:00 | Pub Night 2 | ?? | |||
| Friday AM | The Future | ||||
| 8:00 - 9:00 | ?? | Countrywide | Keynote 3: Guest speaker | ||
| 9:00 - 10:00 | Dr. Hicks | Texas A&M, EZ-Xpert | Verification of Propositional Logic Systems and it's Implications | ||
| 10:15 - 11:15 | Gary Riley | CLIPS | RE-architecting CLIPS: recent Changes to Improve Performance, Integration and Internationalization | ||
| 11:30 - 12:30 | Mark Proctor | Drools | Declarative Programming with Rules, Processes and CEP | ||
| 12:30 - 2:00 | Lunch | ||||
| Friday PM | Parallel and Conference Wrapup | ||||
| 2:00 - 3:15 | Dr. Forgy | PST, Rete, Rete 2 | Parallel Rulebase Technology (jco) - Parallel OPSJ, Rete, Rete 2, New Developments in Rulebase Theory | ||
| 3:30 - 5:30 | Everyone | Everyone | Conference Review | ||
| 5:15 - 8:00 | Pub Night 3 | Party Time | Billy Bob's in Fort Worth | ||
Wednesday, June 25, 2008
Drools Clips progress
Made some progress over the weekend with Drools Clips, which will provide a Clips like language for Drools. Deftemplates are now working and I did some work on PackageBuilder so that it's now able to handle multiple namespaces and have a RuleBase attached to provide a more "shell" like environment suitable for Clips. Michael Neale also got a basic command line shell working. So what does it support?
- deftemplate
- defrule
- deffuction
- and/or/not/exists/test Conditional Elements
- Literal, Variable, Return Value and Predicate field constraints
The screen shot is a contrived example but it does show a shell environment cleanly mixing deftemplates and pojos - note that Drools 5.0 does not require shadow facts, due to the new asymmetrical Rete algorithm. It also shows deffunction in use. This will be part of Milestone1, that I'm hoping to tag tomorrow.
Monday, June 23, 2008
IDE re-license from ASL to EPL
We are looking to re-license our Eclipse IDE code from Apache Software License to Eclipse Public License. The reason for this is to simply align with the bulk of the Eclipse projects out there, to make bundling, deployment and code re-use much easier. The runtime work will remain as ASL.
I don't consider this change any issue as the EPL license is not a controversial one, unlike the LGPL. If anyone can see any issues I guess we can always dual license under ASL and EPL, but I don't want to needlessly confuse things.
I'm looking for community feedback on this before I do the change.
Mark
Friday, June 13, 2008
Drools Job Posting - Drools Designer (Croatia)
Another job posting came in, so thought I'd highlight it in the blog.
Drools Designer
We are currently recruiting for an experienced software engineer with specific knowledge of Java and Rules engines, ideally DROOLS. You must have several years experience as a developer/ designer in enterprise environments, have an excellent grasp of rules engine concepts, supporting database design, and understand current web technologies.
The job is in Zagreb, but home based working is offered.
The opportunity is to work for a very innovative company in the media area on the developmen of a new technical platform. long term prospects very good. The position is that of designer, working with the software architect.
You must be able to demonstrate a very high level of intellectual curiosity about technologies and their use and deployment.
You must be fluent in english.
Click here for more details and to apply for this job.
Friday, May 30, 2008
Drools Job Board Posting, NY
Just thought I'd highlight a job posted on the Drools job board at the moment. Remember the job board is free and all adverts also appear on the side of this blog for maximum exposure.
Core java/J2EE Web Developer
Investment Banking, New York, NY
Development on Insight - strategic risk management tool for Sarbanes-Oxley Section 404 risk assessment. Production support on applications, which includes coordinating with 3rd party vendors and providing support for SOX S.404 users globally. Co-development with 3rd party vendor. Reporting development using JasperDecisions. Work with business users on formulating requirements. Develop technical specifications from business requirements. Unit and integrated systems testing. 5+ yrs of Java/J2EE development on presentation tier and back-end. Open Source frameworks: Spring, Struts, Hibernate, Apache/Tomcat, JBPM, DROOLS. O/S: Linux and Unix. Database: UDB and Sybase. Others: Linux/Unix scripting, Eclipse IDE, MS Office. Familiarity with GoF and J2EE Design Patterns. Desirable Skills: Experience in the financial industry, JUnit, ANT.
Click here for more details and to apply for this job.
Sunday, May 18, 2008
Efficient Binary Protocol Marshalling for Drools Stateful Sessions
New code has been added, in trunk for a highly efficient binary protocol marshalling for stateful sessions. While Drools 4 supported standard serialisation of Working Memories, it used the default serialisation, this is both very slow and memory bloating. It also has the problem that it just serialises the user objects with it.
The new marshalling implementation allows for a strategy approach when handling the marshalling of user objects. You register different strategies for different name spaces. Currently we have two strategies, Serialised and Identity. Serialised just writes the user object to the stream via standard readObject/writeObject methods. Identity assigns the user object an id, from an int counter, and places it in a map and writes the id to the stream. Reading in uses that map to lookup the user object. Identity strategy is thus stateful, the write method can only be called once but read can be called repeatedly. Other strategies will be added, such as hibernate place holder support. Users can of course write there own.
So what does this give?
- Session pause/resume, ideal for moving a session to a new server or restarting an existing server.
- General snap shotting, backup. You could do a poor man's high availability by snap shotting the session at the end of each transaction. Later we will be extending this binary protocol to support journalling and also replication via clustering.
- Pre-loaded session templates. If you repeatedly create stateful sessions with the same base set of data and the insertion time is annoying, now you can just populate the session once and write out to a byte[] and use that as a template for further session creations.
- Long term persistence, needed for our process integration work.
You can see the MarshallingTest to look at the integration tests in place at the moment.
In integrationtests' SerializationHelper you can see the helper methods there demonstrating how it all works.
The DefaultMarshalling class uses the Identity strategy if it is not passed a strategy factory. The Identity strategy is used throughout the tests.
The read/write marshalling is maintained in two files InputMarshaller and OutputMarshaller, this will allow better handling of backwards compatiblity in the future.
It's still very alphaware, but please do start trying it. I need to tidy up the debug output and will do that soon, I'll probably make each read/write method take a String which will be written to the log when debug is on. It currently sorts a number of map/set data structures, this is for debugging so that testing can round trip for data loss, I will make sure that it can be disabled for production. The following types don't yet marshall, not sure how to handle date/time stuff at the moment:
Temporal Sessions do not marshall
Scheduled rules, duration attribution do not marhsall
Implementations have not been added for accumulate, collect, from and rightinputadapter.
We are just hooking up the process marshalling into this at the moment.
Mark
at
4:56 AM
2
comments
Links to this post
Labels: Drools
Tuesday, May 06, 2008
A REST API for Drools
Part of the work for the Drools 5 repository is a Rest API - to allow content to be accessed remotely. The initial purpose of this is to let assets in the repository be synced with files in a developers workspace.
Rest turns out to be a perfect fit, we have the usual verbs:
PUT: update content (create a new version).
POST: create a new asset
DELETE: delete an asset
GET: retrieve asset content, or package listing
All actions are of course in the context of a package - but this is all specified by the url:
http://
So for instance, doing a PUT to: http://
This may be terribly useful to some, terribly un-interesting to others, but at the very least people should appreciate the ability to get and update content to files/workspace from the repository without error prone import processes.
at
12:26 PM
5
comments
Links to this post
Labels: BRMS, Business Rules Governance, Drools, Guvnor
Friday, May 02, 2008
JavaOne 2008
Whilst Mark or Edson's proposals for JavaOne 08 were not accepted (they made the mistake of not including Netbeans or Glassfish in the titles ;), Michael will be attending.
Not doing any specific presentations, but happy to talk, do some ad-hoc demos and generally hang out. I will be around the JBoss/Red Hat stand at least some of the time.
Its a bit of a long trip over from my end of the world, and am not looking forward to the horrific jet-lag that awaits me.
Monday, April 07, 2008
BRMS for Drools 5
Also: Introducing Guvnor.
Guvnor is the new name for the BRMS. The term BRMS kind of has an industry meaning that is slightly different from what we call the Drools BRMS (when we say it, we mean the repository and web tools mostly). Hence, the name Guvnor (kind of related to governance - but really, it just sounds cool). On top of that, we are extending guvnor to manage other asset types - which aren't directly related to rules (but that's another story, for another day).
Anyway, the new look guvnor:
Hopefully, we will have snapshots and milestones available for this very shortly.
Here is a quite tour of some of the more interesting features:
1. Web based decision tables:
This is obviously quite different from the spreadsheet based ones, and use a similar approach to the guided editor to help you set up the table to allow people to enter rule data.
The columns are configured just so:
You can also configure lists of values, or use data driven enumerations (just like before):
You can of course mix and match this with other rule types, as not everything is easy to represent in decision tables.
The most interesting feature (to me) is the integrated testing UI. I am a big fan of test driving anything. So, you can do that with rules. You can specify what you expect your results to be for a given scenario. You can narrow that scenario to an individual rule, if you want, or you can exclude rules (you would want to do this if a particular rule had a destructive side effect). You can also simulate dates for checking date effective rules etc.
This sort of scenario based expectation testing works well when your rules focus on the data and the logic on the data, and avoid programmatic logic and external side effects, of course.
What a scenario looks like:
You can see the expectations (which has one failure in this case) and the input data.
Also, you can treat a list of scenarios as a test suite:
And then run it to get unit test like green/red bars (well all love seeing green !):
From this we can also see what percentage of rules were exercised (and thus increase our confidence that we almost know what we are doing !).
I demonstrated this in Melbourne last week, and this really helped clarify to people what it was all about.
at
12:51 AM
13
comments
Links to this post
Labels: BRMS, Business Rules Governance, Drools
Sunday, April 06, 2008
Revisiting ANTLR
I believe most of you users that had a look at the Drools source code, in special at the parser, knows that we use ANTLR as our parser generator. We started using ANTLR v2, with our first grammar written by Bob, and then we moved to ANTLR v3 right after it was available, still in beta phase.
We always used a regular single step ANTLR generated parser, specially because of this heritage from ANTLR v2, but DRL is becoming a complex language to parse as we make it more user friendly and add features to it.
So, this weekend I decided to learn about the next step in flexibility provided by ANTLR, and that takes the form of multi-step AST/Tree grammars.
Have in mind that I'm a beginner in the parser/compiler black magic arts, but I must say I'm astonished by the simplicity with which ANTLR allows us to handle complex scenarios. AST and Tree grammars are an amazing tool! Add template processing to that and you get something really unique!
I will not repeat here what is in ANTLR docs and specially in Terence's book, but I can safely tell you: if you need to write a parser, ANTLR is the one stop for you and The Definitive ANTLR Reference book is your must read bible. Thank you twice Terence!
So, soon we shall move our main grammar to a multi-step AST/Tree parser, and hopefully get even better user feedback on DRL rules, ranging from better error reporting to more intelligent context assistance. Stay tuned.
My thanks also to Alexandre Porcelli, that provided real-time help with some questions I had during the weekend.
Cheers,
Edson






