Friday, September 19, 2014

The Birth of Drools Pojo Rules

A few weeks back I blogged about our plans for a clean low level executable mode, you can read about that here.

We now have our first rules working, and you can find the project with unit tests here. None of this requires drools-compiler any more, and allows people to write DSLs without ever going through DRL and heavy compilation stages.

It's far off our eventually plans for the executable model, but it's a good start that fits our existing problem domain. Here is a code snippet from the example in the project above, it uses the classic Fire Alarm example from the documentation.

We plan to build Scala and Clojure DSLs in the near future too, using the same technique as below.

public static class WhenThereIsAFireTurnOnTheSprinkler {
    Variable<Fire> fire = any(Fire.class);
    Variable<Sprinkler> sprinkler = any(Sprinkler.class);

    Object when = when(
            input(fire),
            input(sprinkler),
            expr(sprinkler, s -> !s.isOn()),
            expr(sprinkler, fire, (s, f) -> s.getRoom().equals(f.getRoom()))
    );

    public void then(Drools drools, Sprinkler sprinkler) {
        System.out.println("Turn on the sprinkler for room " + sprinkler.getRoom().getName());
        sprinkler.setOn(true);
        drools.update(sprinkler);
    }
}

public static class WhenTheFireIsGoneTurnOffTheSprinkler {
    Variable<Fire> fire = any(Fire.class);
    Variable<Sprinkler> sprinkler = any(Sprinkler.class);

    Object when = when(
            input(sprinkler),
            expr(sprinkler, Sprinkler::isOn),
            input(fire),
            not(fire, sprinkler, (f, s) -> f.getRoom().equals(s.getRoom()))
    );

    public void then(Drools drools, Sprinkler sprinkler) {
        System.out.println("Turn off the sprinkler for room " + sprinkler.getRoom().getName());
        sprinkler.setOn(false);
        drools.update(sprinkler);
    }
}

Share/Bookmark

Wednesday, September 17, 2014

Decision Camp is just 1 Month away (SJC 13 Oct)

Decision Camp, San Jose (CA), October 2014, is only one month away, and is free for all attendees who register. Follow the link here, for more details on agenda and registration.


Share/Bookmark

Tuesday, September 16, 2014

Workbench Multi Module Project Structure Support

The upcoming Drools and jBPM community 6.2 release will be adding support for Maven multi-module projects. Walter has prepared a video, showing the work in progress. While not shown in this video, the multi-module projects will have managed support to assist with automating version updates, releases, and will have full support for multiple version streams across GIT branches.

There is no audio, but it's fairly self explanatory. The video starts by creating a single project, and then showing how the wizard can convert it to a multi-module project. It then proceeds to add and edit modules, also demonstrating how the parent pom information is configured. The video also shows how this can work across different repositories without a problem - each with their own project structure page. Repositories can also be unmanaged, which allows for user created single projects, much as we have now with  6.0 and 6.1, which means previous repositories will still continue to work as they did before.

Don't forget to switch the video to 720p, and watch it full screen. Youtube does not always select that by default, and the video is fuzzy without it.





Share/Bookmark

Monday, September 15, 2014

Setting up the Kie Server (6.2.Beta version)

Roger Parkinson did a nice blog on how to setup the Kie Server 6.2.Beta version to play with.

This is still under development (hence Beta) and we are working on improving both setup and features before final, but following his blog steps you can easily setup your environment to play with it.

Only one clarification: while the workbench can connect and manage/provision to multiple remote kie-servers, they are designed to work independently and one can use REST services exclusively to manage/provision the kie-server. In this case, it is not necessary to use the workbench.

Here are a few test cases showing off how to use the client API (a helper wrapper around the REST calls) in case you wanna try:

https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-server/kie-server-services/src/test/java/org/kie/server/integrationtests/KieServerContainerCRUDIntegrationTest.java

https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-server/kie-server-services/src/test/java/org/kie/server/integrationtests/KieServerIntegrationTest.java

Thanks Roger!
Share/Bookmark

Tuesday, September 02, 2014

Activity Insight coming in Drools & jBPM 6.2

The next Drools and jBPM 6.2 release will include new Activity pages, that provides insight into projects. Early versions of both features should be ready to test drive in the up coming beta2 release, end of next week.

The first Activity page captures events and publishes them as timelines, as a sort of social activities system - which was previous blogged in detail here.  Notice it also now does user profiles This allows events such as "new repository" or "file edited" to be captured, indexed and filtered to be displayed in custom user dashboards. It will come with a number of out of the box filters, but should be user extensible over time.

click to enlarge

We have a video here, using an old CSS and layout. The aim is to allow for user configurable dashboards, for different activity types.

We have also added GIT repository charting for contributors, using the DashBuilder project. There is a short video showing this in action here.


click to enlarge


Share/Bookmark