Flow4j.FlowDesigner News
Project Info
SourceForge Logo

Flow Designer

The flow designer is a Swing application that is used to design process flows. The following picture shows the designer environment, where each flow has its own window, so its possible to work on more than one flow at the time.

Error Checking

While designing the flow, you have the possibility to check errors in the flow. Activate the "show errors" menu item in the Flow menu to achieve this feature. All errors concerning flow errors are displayed at the approriate flowlet in red color. Such errors can be the missing name of a StartFlowlet or wrong systax of TaskFlowlet properties.


The entry point of every flow is a StartFlowlet with a unique name inside of the flow. The default name is "Start". A flow can have more than one entry point as shown in the next figure. The name of the StartFlowlets has to be different to avoid ambiguities.


A taskFlowlet has a class name, that is the fully qualified class name of the java class, and a number of properties. Properties are bound to the TaskFlowlet where they are defined. For example its possible to use the same TaskFlowlet type SendMail more than once in a flow with different smtp IP addresses.

Property entries have the following syntax:

key = value

The key will always registered as a String value.

  age = new Integer(12)
  name = "Alex"
will be put in the TaskFlowlet's property list as
  setProperty("age", new Integer(12);
  setProperty("name", "Alex);

You can retrieve a property in the TaskFlowlet's implementation with

  String nameToWorkWith = (String)getProperty("name");


A flow can contain decisions to delegate the process flow dynamically. The following image displays such a DecisionFlowlet.

The true branch has green color and the false branch is displayed red. You can change the boolean value of the connection in the properties pane of the left frame. To see the checkbox, first select the connection.

Every DecisionFlowlet needs to have a statement that evaluates to a boolean. The statements are interpreted by BeanShell at the time the flow is initialized. The statements has a very java like syntax. Every key in the dictionary can be referenced, BeanShell fetches the value automatically and does automatic type conversion. See the BeanShell documentation for further information on the syntax of the statements.

If the dictionary has the following content {["myBool"=true],["num"=12],["text"="hello"]} then you can use the keys in the statement without having to bother with fetching keys and values from a java HashMap.
Here you can see some exampes:

sample statement description
myBool myBool is the key in the dictionary; value is of type java.lang.Boolean
value==12 value is the key; value is of type Integer; the number value could also be of type double or long ...
text.equals("hello") text is the key; value is of type String
myBool && num+1>10 && otherBool myBool, num and otherBool are keys in the dicctionary; combination of operators is possible


The JoinFlowlet is a convenience flowlet that lets you join some branches to one resulting branch. To be precise maximum three incoming and one outgoing. The following picture illustrates this.

Many flowlets have more than one connector, like the TemplateFlowlet, but in some cases it's better to use the JoinFlowlet for better visualisation.


The CallFlowlet makes it easy to call another flow from within the current flow. This makes sense if the flow becomes very large and you want to group parts of the flow. So called SubFlows can be declared in the same flow, with another StartFlowlet name, or in a comletely diferent flow. The dictionary of the caller flow is transfered to the called flow, so the called flow can manipulate or populate the common dictionary. After the called flow terminates, the remaining flowlets of the caller flow are executed. The syntax is

Its important that the called flow terminates with an EndFlowlet.


Every flow has to be terminated. One way to do this is with a simple EndNode. In this case flow execution terminates at the EndFlow and the caller application or caller flow gains control and can use populated dictionary.


The JumpFlowlet is a terminating flowlet like the EndFlowlet but transfers complete control to the following flow. The syntax is the same as at the CallFlowlet:


The is a termaninating flowlet, that appears at the end of a flow. The name of the template can be any string like the name or path of a JSP page. You can see some examples in the preceeding picture. In a servlet context the FlowServlet forwars to the page, specified with the template flowlet.

Flow Java Source

At the time when the flow is saved, the designed flow is serialized to java and compiled afterwords with a java compiler. The source code of the flow can be checked with the "source" panel in the right frame of the flow window. This panel is currently only for debugging reasons, but may be of interest to some curious people :)

  v0.5.1 released
minor changes

v0.5 released
FlowServlet implemented
Flowlet interface changed
new Flowlets: Call, Jump, Join

v0.4.5 released
Bugfix release

v0.4.4 released
EndFlowlet introduced.
DecisionFlowlet implemented.
TemplateFlowlet implemented.

v0.4.3 released
Using Kopi compiler instead of InstantJ.
Checking some Flow errors.

v0.4.2 released
TaskFlowlet properties implemented
Ant buildfile redesigned. Avaliable for windows too.
many samples!

v0.4.1 released
Bugfixes and designer improvements.

v0.4 released
Designer is written in Nice. Compiles the flow while saving in jar file.
Missing Flowlets will follow soon.

Designer relaunch
The Designer will be completely rewritten without JHotDraw. The saved flow format will change!!!