Planning Expert System (part 2 of 4)

In part 1 of this series I described the project – to build an ‘expert system’ that would allow a user to answer a series of questions to establish whether or not they required a planning permission for their proposal.

In this edition we’ll try to establish whether there is an ‘engine’ that can do the donkey work of allowing people to walk through a series of nodes, answering questions.

I’m reminded of multiple storyline books that became strangely popular in the mid 80s:

“If you decide to fight the savage cannibals, turn to page 40;

If you decide to flee by jumping in the crocodile-infested waters, turn to page 62;

If you decide to do nothing, turn to page 12.”

This *must* be something that lots of people have needed to do. I felt sure that there would be dozens of choices open to me. Every person you speak to at a damned call centre is using some kind of diagnostic script – they must be out there.

Thus I began a very frustrating couple of days in front of google. Perhaps I’m a victim of this area of work being a bit boring and primarily about some big corporate players making money from their CRM. In any event I found very little that suited me. It seemed in the end I had few real options:

Platforms : ruby on rails, xforms

Languages : Jess (a rule-based Java environment with a tantalising glimpse of a great tutorial)

Commercial web applications : Treeage, Firefly (informavores), VanguardSW

Other : Open Rules (excel + java)

I’ve been looking for an excuse to try ruby on rails for a while, but the limits on time precluded it. Similarly I don’t have time to run a procurement exercise for anything commercial. OpenRules seemed interesting, but lots of the interesting stuff would end up hidden in Java rather than living in XML structures. Jess looked great, and the example of a tax form was a great proxy for what we’re trying to do with planning.

However, I was most excited by the xforms approach. If it worked it might even be an elegant answer, and here was an approach that almost required an XML approach end-to-end. Plus, it is achingly trendy in a web 2.0 kind of way. Glossing over more time spent hunched over google the choice came down to Chiba and Orbeon (given that our audience would not have the freedom to install xform add-ons to their Mozilla browser or install dedicated xform processors like formsplayer).

In my standard, non-scientific way I chose Orbeon. It was under active development, I could see clever people were using it and if all else failed I could buy my way out of trouble.

The remainder of this part is my scrappy install notes of getting Orbeon up and running. Given I have as many administrative priviledges as a gnat on my work machine, I’ve used a spare laptop running linux so that if it does end up working I can show people. We need five things:

  1. An operating system (Ubuntu)
  2. A programming language (Java) – not that we want to do any hardcore coding, mind you
  3. A web server that can display the form and content (Apache tomcat)
  4. An xforms engine (Orbeon)
  5. Other stuff, like tools to make working with XML less painful (don’t know, yet)

Download & install Ubuntu 8.04 LTS from the nice folk at Ubuntu.

Using synaptic, install Sun’s JRE and JDK (first !)
(double check by

richardc@ricbuntu-laptop:~$ java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

To get tomcat working I used the manual install instructions from howtogeek (thanks HTG – I had real trouble getting the standard tomcat 5.5 in the repo working)

I downloaded the tar.gz from the binary section by clicking it from http://tomcat.apache.org/download-60.cgi
edit the JAVA_HOME variable as per the next section in howtogeek. You can check the installation by

richardc@ricbuntu-laptop:~/Desktop$ cd /usr/local/tomcat/ bin
richardc@ricbuntu-laptop:/usr/local/tomcat/bin$ ./startup.sh
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr

lack of errors = good, then double check with web browser by
http://localhost:8080/
to see tomcat message.

[tomcat 6.0 = done, now orbeon …]

download nightly build from orbeon

take instructions from http://www.orbeon.com/ops/doc/intro-install using the tomcat section

assuming you copied tomcat to the same place as ubuntugeek, TOMCAT_HOME = /usr/local/tomcat so …

richardc@ricbuntu-laptop:/usr/local/tomcat$ mkdir webapps/orbeon

I then used the GUI unzipper to extract all the files (not just the .war file) into the orbeon directories

richardc@ricbuntu-laptop:/usr/local/tomcat$ ls webapps/orbeon/
doc  examples-cli  orbeon.war  README.txt  third-party-licenses
richardc@ricbuntu-laptop:/usr/local/tomcat/webapps/orbeon$ unzip orbeon.war
(big fat list of unpacked files ...)

The next install instruction foxed me

3. With Tomcat 5, move xercesImpl.jar and xmlParserAPIs.jar from common/endorsed to server/lib. This way Xerces will be available to Tomcat, but it won’t override the version of Xerces and standard XML APIs that comes with Orbeon Forms.

I think this means “within the tomcat directory …”, but the directories don’t make much sense.

richardc@ricbuntu-laptop:/usr/local/tomcat$ locate xercesImpl.jar
/usr/share/java/xercesImpl.jar
richardc@ricbuntu-laptop:/usr/local/tomcat$ locate xmlParserAPIs.jar
/usr/share/java/xmlParserAPIs.jar
richardc@ricbuntu-laptop:/usr/local/tomcat$

let’s ignore the bit we don’t understand, restart tomcat and see …

richardc@ricbuntu-laptop:/usr/local/tomcat$ sudo /etc/init.d/tomcat stop
..
richardc@ricbuntu-laptop:/usr/local/tomcat$ sudo /etc/init.d/tomcat start
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/lib/jvm/java-6-sun

then browse to
http://localhost:8080/orbeon which redirects to welcome screen at
http://localhost:8080/orbeon/welcome/

phew

phew

hoorah! Next part will cover the first draft of the xml schema, and then we can see if this thing will actually fly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s