Quick Start Guide: Workflow for Software Developers

VERSION 1 Published

Created on: 30-Jul-2007 18:09 by Lillian Bozonie - Last Modified:  23-Aug-2007 10:33 by Lillian Bozonie

Workflow for Software Developers

If you are reading this document, it is assumed that you have downloaded and installed Flux onto your computer. If not, browse to www.fluxcorp.com/download for a free trial version of Flux.

This guide will model workflow and the steps involved in programming using the Flux APIs. Workflow can be a very powerful tool when complex tasks are needed to be automated. The flow chart we will be using is a simple workflow example that illustrates the capabilities and usages of Flux's workflow. A random number generator is used to generate different numbers. Once these numbers are generated, whichever flow has the appropriate condition for the number will be followed.
<h3<The following topics will be discussed:</h3>
  • Creating Flux nodes (actions and triggers)
  • Setting flows and conditional flows
  • Using join points

Open the ?Workflow.java? file included in the same directory as this document with the program you usually use to work on Java programs
If you using an IDE and have not configured it to work with Flux, you will have to arrange your IDE to point to the appropriate Flux jar files. The "flux.jar" file located within your Flux installation directory, as well as the jar files located inside the "lib" directory also underneath your Flux installation directory, are needed for this example to compile correctly.
The Flux API heavily employs the use of factory and helper classes to create instances of objects.

There are three vital examples of this illustrated in the example:

  • The Factory class, which is instantiated by calling the static method Factory.makeInstance(), is the quintessential element in a work flow. From the Factory, several key objects are manufactured; such as engines and security
  • An EngineHelper is manufactured from the Factory class and is used to create flowcharts, business processes, Cron objects, and other supplementary classes to building a work flow
  • The Flowchart class is the basis of building workflows. Each flowchart could be considered a workflow. The FlowChart object is a factory for constructing most actions and triggers.

The example also uses a join point. Join points are a configuration option all actions and trigger share that simply tells Flux to wait for all incoming flows to arrive at the point before continuing on. This is useful if you fork your workflows into different sub processes, such as copying files in one.

This action must wait for all inbound flows to complete before executing.
Also, notice the "Else" and conditional flows that were added towards the bottom of the "Workflow" constructor. These flows are only followed upon their conditions being met. For example, the "Else" flow is only followed if, and only if, all other flows are not followed. The "NUMBER < 34" flow will be followed only if the number that is generated is less than 34.

Next, run this example using your Java IDE. You will see lines similar to the ones shown below, printed to your console.

Flow Chart has started.
All Timer Triggers have fired. The join point is
satisfied and executing......
 
The number generated was "9" which is
less than 34.

This behavior will be repeated 3 more times before the Timer Triggers are exhausted. Notice how the join point waits for all Timer Triggers to flow into it before executing.

Congratulations, you have just used Flux's APIs to implement workflow capabilities. If you wish to learn more about Flux's workflow abilities, browse to your "examples/software_developers" directory, under your Flux installation directory. This directory holds more examples that go into greater detail on the abilities of using workflow. Many references to workflow can also be found in the "Software Developers Manual" found in the "doc" directory of your Flux installation directory.
Average User Rating
(0 ratings)




There are no comments on this document