Knowledge Agent
Incremental change-set processing
The new version of the Knowledge Agent supports newInstance = false in its configuration (incremental change-set build). When setting this property to false, the kbase instance of the agent is reused when changes in the monitored resources are detected.
- Rules: For rules, the Agent searches for modifications in its attributes, LHS and RHS.
- Queries: queries are always replaced on kbase wether they are modified or not.
- Other definitions: All other definitions are always replaced in kbase (like if they were modified). We expect to add better support for definition’s modification detection in further versions.
The current implementation only supports the deletion of rules and functions definitions. For further information please take a look at:
- http://ilesteban.wordpress.com/2010/03/25/knowledge-agent-incremental-change-set-processing-and-binary-diff/
- http://ilesteban.wordpress.com/2010/05/26/knowledge-agent-incremental-change-set-build-implementation/
Live Querries
Drools has always had query support, but the result was returned as an iterable set; this makes it hard to monitor changes over time. Live Querries have a listener attached instead of returning an iterable result set. These live querries stay open creating a view and publish change events for the contents of this view.
ViewChangedEventListener listener = new ViewChangedEventListener() {
public void rowUpdated(Row row) {
updated.add( row.get( "$price" ) );
}
public void rowRemoved(Row row) {
removed.add( row.get( "$price" ) );
}
public void rowAdded(Row row) {
added.add( row.get( "$price" ) );
}
};
// Open the LiveQuery
LiveQuery query = ksession.openLiveQuery( "cheeses",
new Object[] { "cheddar", "stilton" },
listener );
Timers and Calendars
Rule’s now suport both interval and cron based timers, which replace the now deprecated duration attribute.
timer ( int: <initial delay> <repeat interval>? )
timer ( int: 30s )
timer ( int: 30s 5m )
timer ( cron: <cron expression> )
timer ( cron:* 0/15 * * * ? )
Calendars can now controll when rules can fire. The Calendar api is modelled on Quartz :
public interface Calendar {
boolean isTimeIncluded(long timestamp);
}
Quartz provides several good Calendar implementations, so it makes sense to leverage those, for this we we provide an adapter helper method:
Calendar QuartzHelper.quartzCalendarAdapter(org.quartz.Calendar quartzCal)
Calendars are registered with the StatefulKnowledgeSession:
ksession.getCalendars().set( "week day", weekDayCal );
Which means they can now be used in rules. They can be used in conjunction with normal rules and rules including timers.
The rule calendar attribute can have one or more calendar names.
calendars “calname”
calendars “calname1”, “calname2”
Drools Spring integration
Drools Flow easy configuration
We keep improving the integration with Spring Framework. We added support for configuring a Drools Flow JPA session for using it with a local transaction manager.
(Now if you don’t need to configure variable persisters the jpaSessionServiceFactory is only one line! :))
More info and usage examples in: http://blog.bauna.com.ar/index.php/2010/05/drools-flow-configuration-using-spring/
Drools Camel Integration:
So, you can use any of the out-of-the-box Camel Components as a Drools commands producer, which allow to create more powerful services interactions. At this moment, we provide out-of-the-box marshallers for XStream & JAXB.
If you want to read more about how to configure and use the Drools Camel endpoint take a look at the following link:
http://lucazamador.wordpress.com/2010/05/28/drools-apache-camel-integration/
Drools Execution Server:
A new version of Drools Server is included in this release. This version add the support for Stateful Knowledge Sessions. Internally, for this new version, we use drools-camel, drools-spring and drools-grid to provide the following list of new features:
- Stateful/Stateless Knowledge session support
- RestWS & SOAP services to interact with the sessions
- Spring configuration
- JAXB/XStream XML commands support (using the out-of-the-box provided marshallers in drools-camel)
You can read more about this in the following blog post: http://lucazamador.wordpress.com/2010/05/27/drools-server-spring-configuration/
Extensive BPMN 2.0 support
- more extensive event support: much more combinations of event types (start, intermediate and end) and event triggers (including for example error, escalation, timer, conditional and signal events), have been included, as well as (interrupting and non-interrupting) boundary events
- sub-process parameters
- diverging inclusive gateway
- etc.
- the ability to use BPMN2 processes in combination with our Eclipse tooling
- Guvnor as process repository
- web-based management using the BPM console
- auditing and debugging
- domain-specific processes
- etc.
Installation script
The Drools build now contains an install folder that simplifies installing the Eclipse plugin, Guvnor and the gwt-console. It creates and copies the necessary jars and wars and deploys them to the JBoss AS. It also includes a simple evaluation process example you can use to test your setup. For more info, take a look at the readme in the install folder.
JMX Monitoring improvements
Session Inspection and Reporting framework
To inspect a session, one can use the following API calls:
StatefulKnowledgeSession ksession = ...
// ... insert facts, fire rules, etc
SessionInspector inspector = new SessionInspector( ksession );
StatefulKnowledgeSessionInfo info = inspector.getSessionInfo();
The StatefulKnowledgeSessionInfo instance will contain a lot of relevant data gathered during the analysis of the session. A simple example report template is provided and can be generated with the following API call:
String report = SessionReporter.generateReport( "simple", info, null );
Guvnor
Updated to GWT 2.0
GWT was updated, making Guvnor faster.
Build in selector
The built in selector allows user to choose what assets to build according to:
1. Status (eg, Dev, QA etc)
2. Category
3. Metadata
Single asset verification
It is possible to verify just the asset you are working on ( ruleflow, rule, decision table ). Verification finds issues like conflicting restrictions in a rule or redundant rows in decision tables.
Global area
Assets stored in Global area can be shared to all packages.
Diff check between snapshots
Lists the changes between two snapshots.
Viewing multiple assets in one tab
Makes it possible to open more than one asset into one view. All the assets can be saved and edited as a group.
Pattern order
From/Collect/Accumulate support
Guided Editor has basic support for From, Accumulate and Collect Patterns. You can add any of these structures as regular Patterns.
Templates
Working Sets
Working Sets are a mean for grouping Facts and then defining constraints on them. You can create groups of Facts and only those Facts will be visible when authoring rules using the Guided Editor.
Fact Constraints
Once you have grouped facts in a Working Set you can define restrictions on those facts’ fields. The restrictions that you define will be used to validate what you can write on rules.
For further information you can read: