Hanoi Workflow Engine

Jon Tirsen

Abstract

This document describes the Hanoi Workflow Engine. It is known to be inakurate, incomplet and inconSistenT.


Table of Contents

1. Introduction
2. Process Beans
Activities
Input parameters
Output parameters
Bindings
Transitions
Simple
Conditional
Resources
Configuration
Builders
Processors
3. Designer
4. Engine
5. How to

Chapter 1. Introduction

TODO

Chapter 2. Process Beans

Process beans are plugins into Hanoi. All plugins reuse as much as possible of the JavaBean component model.

Activities

Activities are things is actual work in a workflow.

Input parameters

Input parameters are writable JavaBean-properties (they have a setX-method). They will be set before the activity is executed according to its bindings.

Output parameters

Output parameters are readable JavaBean-properties (they have a getX-method). When the activity has been executed they will be read and the datasheet updated according to its bindings.

Bindings

Input parameters can be bound to a value, a resource or a variable in the datasheet. Output parameters can be bound to a variable datasheet in a datasheet.

Transitions

When an activity has finished execution all transitions from this activity are evaluated. The "to"-activity of the first transition that evaluates to true is used as the next activity.

Simple

Simple transitions are unconditional and will always evaluate to true. They are used when an activity unconditionally leads to another activity.

Conditional

Conditional transitions will transfer the current activity after the "from"-activity has been executed to the "to"-activity if the condition is true. The condition is written using ognl which supports all Java-operators (and more) and is executed against the current state of the datasheet. That is, all datasheet-variables can be referred to but not output parameters of the previous activity, they need to be bound to the datasheet to be used in a condition.

Resources

Resources are things that the workflow uses. They do not posess any runtime-state, all state must be configured while designing a process definition and does not change during the execution. They are often meant to be interfaces into external systems or components. Activities needs to be implemented that know how to do work against a resource of a particular type.

Configuration

All configuration is done through JavaBean-properties.

Builders

In the future any plugin to the designer may specify functionality for installing, removing and validating itself against a process definition. This makes it possible to customize much of the functionality in TODO Install, Validate

Processors

Processors are interceptors that takes over the control when executing an activity. They are chained so that several processors can be added to a process definition. They may provide additional functionality such as logging, statistics, deadline-management, exception-handling and so on. Bindings are implemented as a processor. TODO Processors are not pluggable yet, nor configurable.

Chapter 3. Designer

The Designer is used to edit and create process definitions. Process definitions are saved into files typically ending with '.hanoi' and loaded into an Engine to be executed.

Procedure 3.1. Editing bindings

  1. Select the activity to edit bindings for in the list or in the graph. The input and output-parameters to theactivity is now shown in the "Property" panel.

  2. Select the property to edit bindings for. The current bindings are now shown in the "Bindings" panel.

  3. Select what to bind the input parameter to:

    • Resource.  This binds the input parameter to a named resource.

    • Value.  Binds the input parameter to a constant value.

    • Variable.  Binds the input parameter to a runtime variable in the datasheet.

  4. Select a resource or variable to bind input parameters to or enter a constant value.

  5. Output parameters can only be bound to the datasheet. Select the variable to bind it to.

Chapter 4. Engine

The Engine executes process definitions and provides the instance with its execution environment. Resources may be written specially for a particular engine, such as a J2EE-engine offers support for accessing EJBs and Java Connectors while other engines support other functionality. An engine implemented using EJB is currently implemented and some experimental code exists for an engine that can control a web application written in wingS.

Chapter 5. How to

How to do some stuff in the current release. Most of this will be changed in the future.

Procedure 5.1. Starting the designer

TODO hanoi_designer.jar, maybe have to modify the classpath.

  • Execute java -jar hanoi_designer.jar the lib directory.

Procedure 5.2. Adding a new activity or resource

TODO Add under src/samples/workflows.

  1. TODO Create a class and add it in a package under src/samples/workflows. (Yes, of course, this most definitely will change in the future!)

  2. TODO In the Designer choose Add Class... in File menu.

  3. TODO Enter the fully qualified name of the class. The Designer will automatically determine if the class is an activity or a resource.

Procedure 5.3. Deploying workflows the EJB Engine

TODO JBoss 3.0. Save with .hanoi ending under src/samples/workflows. Use ant-script.

  1. Install and build XDoclet from CVS (Hanoi uses XDoclet functionality not yet released). You also need JDK 1.4 and JBoss 3.0.

  2. TODO Set up the correct directories in build.properties. XDoclet and JBoss.

  3. Start the JBoss server.

  4. In the root of the distribution execute ant deploy.jboss this will rebuild Hanoi and also include you definitions in the build. (Yes, this will also change!)

Procedure 5.4. Executing workflows in the EJB Engine

TODO JBoss 3.0. Surf to the correct page. Choose definition. Execute!

  1. Start the JBoss server.

  2. Direct your web browser to http://localhost:8080/hanoi/admin.

  3. Click "Create Instance...", enter id of definition and click "OK". The id is the package name which it has been saved under with '.' replaced with '/' and the filename with the ending '.hanoi' removed. For example if you save a definition as "test_workflow.hanoi" in the default directory described above ("com/tirsen/hanoi/samples/workflows") the id of your definition is "com/tirsen/hanoi/samples/workflows/test_workflow". A new instance is created in the list of instances.

  4. Click the new instance and click "step" (executes one activity) or "execute" (executes until one activity is waiting).