Sunday, 14 September 2014

Setting up Drools Execution Server

The Drools Execution server (6.2.0-Beta2) has a demo video which looks good, but I needed to know how to set it up on my own machine.

It is not quite obvious how to do this (but this is beta code, so there is a good excuse for that). Still, I thought I'd document how I did it here to save others time.

I'm running Xubuntu 14.04 but the operating system is unlikely to be relevant. Translate as necessary to Windows or OSX path names.

First you need an application server. I'm using Wildfly 8 (used to be called JBoss). Get Wildfly-8.1.0.Final.zip and unzip it into a directory we will call . You need to add a couple of user names before you start it up. Use the /bin/add-user.sh script to add two users we'll call user1 and user2. Make user1 an admin user and user2 an application user. Leave the groups field empty for user1 and (confusingly) make the group of user2 'admin'.
For the question after groups enter 'no'.

Now you can start Wildfly using /bin/standalone.sh and browse to http://127.0.0.1:9990 and log in as user1.

Download the two war files you'll need.
Drools Workbench (this is the Wildfly-specific version)
Drools Execution Server

Edit: I see those two links have gone dead. Here is how to find the right files. Go to this link (it may take a while to load). Now find the JBoss Releases repository. In the lower panel find the org/kie/kie-drools-wb and org/kie/kie-server-services. Under each of those are various versions you can chose from. You want two war files with the same version, bearing in mind the workbench has a specific war file for the app server in each version.

Use the Wildfly Management to load and enable the two war files.
Edit: it is a good idea to shorten the names when you load the war files, that's the second  question during the Wildfly load, and it means your url will be shorter.

We're nearly done...

Log into this URL using user2
http://127.0.0.1:8080/kie-drools-wb-distribution-wars-6.2.0-20140912.025916-106-wildfly8

(or, if you shortened the name you might use http://127.0.0.1:8080/kie-drools-wb)

Okay, now you are in the demo. The ones in the video have some different files loaded but the ones you have now seem to work. You can certainly deploy them and you can certainly call them with a REST client.



Saturday, 6 September 2014

People who say 'Well I think..."

Here I am listening to a radio broadcast of a panel discussion between several
political candidates in our impending general election. It's a well run discussion (thanks to the skills of Wallace Chapman), and unlike some similar events, everyone is behaving well so we all get to learn a lot about who thinks what about what. This is good. Here is the relevant

But what I'm more interested in here is not so much the specifics as the pattern they take. For example there is a question about what the voting age should be. Currently it is 18. I remember (just) when it was 21. Should it be higher? Should it be lower? What do you think?

This seems a good question, certainly worth asking. At 18 we can sign contracts, marry (actually we can do that at 16), vote, buy alcohol and join the army. We don't have any need to conscript soldiers just now, but when we have had such a need it has been tied to the voting age on the understanding that if you're not old enough to vote you're not old enough to be made to risk your life for your country.

So the panel tossed the question back and forth with answers starting with 'well I think...' and speculating that some younger people are old enough to vote and perhaps they should. Then others think it is about right or maybe could be higher, especially with alcohol purchasing.

What no one suggested is actually studying the people involved. Do we have any good data on how well informed 10 year olds actually are? 12 year olds? 14? 16? 18? Surely this is critical to setting the age. We know from other studies that IQ has been shifting upwards for years. This is called the Flynn Effect (Flynn is a New Zealand scientist, but the effect is observed world wide). So it is not unreasonable to suppose that our understanding about how younger people  make decisions is out of date.

Step back a bit, though. This is really not about the specifics. It is about gathering data. It is not enough to base policy on 'well I think...', and it seems we do too much of this. What any of us 'think' about some issue is far less relevant than what the data says.

Another example just to round it out: we have a minimum wage in NZ. Some people think it should be raised, others want to scrap it. The latter tend to say that raising it will cost jobs. This is a 'well I think...' statement. It is very easy to show data that raising the minimum wage does not cost jobs by looking at what has happened when this was done elsewhere. I've yet to see a study referenced that shows it has cost jobs. Maybe there is one, but let's see it instead of having people say 'well I think...'

So watch out for people saying 'well I think...'. If you can, ask them why they think that. Press them for data, some reference to some properly conducted study that demonstrates what they are saying is true (or at least not false, which is subtly different but okay). If you want to pursue this further get hold of Karl Popper's The Open Society and its Enemies which is about some other things as well but he argues better than I can for evidence based policy. Popper wrote this while he was lecturing in Christchurch, NZ during WWII (as an Austrian Jew he needed to leave Europe, but his German heritage made him unwelcome in the armed forces on our side). So there is a local connection there too.