Drools 5.0 will be split 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)
All things Artificial Intelligence related: Rules, Processes, Events, Agents, Planning, Ontologies and more :)
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.
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);
...

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"));<inherits name='com.yesmail.gwt.rolodex.Rolodex'/>Now, after the project has been rebuilt and redeployed we get the following widget on the screen:



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();
Integrated scenario testing



Package[] packages = pkgBuilder.getPackages();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilder pkgBuilder = new PackageBuilder( ruleBase, null );
declare StockTick
@role( event )
@timestamp( timestampAttr )
companySymbol : String
stockPrice : double
timestampAttr : long
end
declare StockTick
@role( event )
end
declare Person
name : String
age : int
end
# 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
$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 );
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.
SessionConfiguration conf = new SessionConfiguration();
conf.setClockType( ClockType.PSEUDO_CLOCK );
StatefulSession session = ruleBase.newStatefulSession( conf );
Current active nodes in a workflow in a specific breakpoint:
New Nodes
This one ows a new "Notificatoin" work item:
<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>

| 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 | ||