Getting Started

This guide describes how to get started with development on a Flowfuse-based workflow application. If you rather like to install the sample application, there will be a installation guide at Flowfuse in Five Minutes soon.

Get the Code

Until the Flowfuse development team will provide stable releases it is best to checkout the latest sources from CVS.

See here for information about getting the source.

Set-up Environment

Before starting development make sure that you have set up your development environment properly. The following packages are required:

  • JDK 1.4.2_10+
  • Maven 1.0.x (Maven2 will not work)
  • MySQL 4.1.x
  • Tomcat 5.0.x

1. JDK

Make sure you have set up your JDK properly (JAVA_HOME set, JAVA_HOME/bin added to your path). Flowfuse has been developed using 1.4.2. Other versions may also work.

2. Maven

Flowfuse uses Maven 1.0 as its build system. To install Maven the following steps are requred:

  1. Download and unpack Maven 1.0.2 (from http://maven.apache.org/maven-1.x/). The zip archive is recommended.
  2. Set your MAVEN_HOME to point to your installation directory.
  3. Add MAVEN_HOME/bin to your path to allow for easier execution from the command line.

After that you have to configure your build system:

  1. Copy <FF_HOME>/build.properties.sample to <FF_HOME>/build.properties.
  2. Change <FF_HOME>/build.properties as needed.

Note: Do NEVER check-in build.properties!

After that have a look at FF_HOME\src\main\config\flowfuse.properties and adjust it if required.

3. MySQL

The Flowfuse developers use MySQL for development and testing. Other databases should work, too, but have not been tested (please let us know if you do so).

  1. Download and install MySQL 4.1.x (from http://www.mysql.org).
  2. Open MySQL Command Line Client to create Flowfuse database.
    $ create database flowfuse;
  3. Import DB schema by using the 'ff:setupdb' maven goal:
    $ maven ff:setupdb
    Note: If you do this the first time please make sure that you comment (disable) the first to lines in <FF_HOME>/src/sql/oswf-schema.sql like that:
    #alter table OS_HISTORYSTEP drop foreign key FK7835C76583353828;
    #alter table OS_CURRENTSTEP drop foreign key FK8710A5CA83353828;
    drop table if exists OS_HISTORYSTEP;
    :
    Otherwise the script will fail, b/c it tries to drop foreign key which do not exeist.

4. Tomcat

A servlet container is required to run Flowfuse. Flowfuse has been developed and tested with Tomcat, but other containers may work to (please let us know). Installing Tomcat requires the following steps:

  1. Download and unpack Tomcat 5.0.x on your system (from http://tomcat.apache.org/download-55.cgi).
  2. Add the following line to your Tomcat startup file to let Flowfuse find the flowfuse.properties file:
    set JAVA_OPTS=-Dflowfuse.configuration=
        <FF_HOME>\\src\\main\\config\\flowfuse.properties
    Note: You have to adjust the path separators according to your platform.
  3. If you want to set up remote debugging add the following line instead (all in one line):
    set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE
        -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
        -Dflowfuse.configuration=<FF_HOME>\\src\\main\\config\\flowfuse.properties
    Note: You have to adjust the path separators according to your platform.
  4. To copy required libs to Tomcat's common/lib and update the tomcat-users.xml fil using the following command:
    $ maven ff:setuptomcat

Note: You have to restart Tomcat to let this change affect Tomcat.

5. IDE

Regardless of what IDE you use (we prefer either Eclipse or IDEA) you can leverage Maven's goals to generate project files for your favourite IDE:

  • If you use Eclipse run the following goal:
    $ maven eclipse
    After that you have to set the classpath variable 'MAVEN_REPO' under Window > Preferences > Java > Build Path > Classpath Variables.
  • If using IDEA run:
    $ maven idea

Build and Deploy

Ok, now we're ready to rumble: Either you can build the WAR and deploy it manually in Tomcat or you let Maven also do the deployment. The latter is recommended.

Build a WAR file using the following command:

$ maven war
After that you are can deploy Flowfuse.

However, it is much easier to let Maven do both:

$ maven tomcat:deploy -Dmaven.test.skip=true

Please note: If you have already deployed Flowfuse, use this one:

$ maven tomcat:redeploy -Dmaven.test.skip=true