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.

Friday, May 23, 2008

Accessing Guvnor as a Filesystem (WebDAV)

Just checked in to trunk, is the capability to access the repository back end as a filesystem. This is useful for a whole lot of cases (including, for instance, saving Excel directly to the repository). Its also a neat lead into the ability to have files both in the repository for governance and editing, and in the IDE for devlopers (probably lots of other uses as well).

This is using the WebDAV standard (Level 2 compliance). WebDAV is reasonably well supported by most operating systems, many end user applications, and various 3rd party clients (and command line utilities for those so inclined). It works over http(s).

Here is a look-see of how a repository looks in OSX finder:

And here it is in windows (xp) explorer:

How to setup: On the repository side - nothing ! The url to access it is the same as the repository server, with /webdav on the end (instead of any HTML file). You can drill down in the URL if you like, by adding: webdav/packages/ - "packages" is required (at the moment it provides a package centric view - packages are folders for this purpose). You can copy and delete packages just like folders, drag and drop things to your hard drive etc...

On the client side:
* Mac OSX finder: Press Apple-K, and then enter the URL (it will prompt for some credentials to access the repository).
* Windows XP: Go to "My Network Place", then "Add a network place" - and use the URL (you can create a shortcut to it on the desktop or wherever.
* Cyberduck: an excellent free client for OSX that works much better then finder (OSX finder is inefficient, and tries to do Naughty Things which gave me no end of grief...)
* Other apps, such as excel, can support webdav URLs more directly if needed.

As the repository is versioned, this is essentially an automatic versioning file system. To avoid millions of trivial little versions being created, it won't create a version with every little save, it will wait until a certain amount of time has passed before creating a new version in the repository automatically (but you won't notice anything from the filesystem point of view). If you really want it to create a new version, you can delete it and drag a new copy over again.

Some caveats:
OSX finder will not let you copy and paste (mostly due to its inability to rename copies to anything useful - maybe fixed in a future version of Finder), so don't try (if you want to copy something, drag it to your mac desktop, rename it, edit etc, and then drag it back).

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.


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:


So for instance, doing a PUT to: http:///api/packages/SomePackage/SomeAsset.drl will update the content of the SomeAsset.drl.

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.

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.