Knowledge Base
Examples
Quick Start Guides

Workflow for Software Developers

It is assumed that you have downloaded and installed the latest version of Flux. If not, browse to www.fluxcorp.com/download for a free trial version of Flux.

Conditional flows and join points in Flux allow you to use the results of your triggers and actions to control when and where your flow chart branches.  Follow the steps below to learn more about  implementing workflow through the Flux APIs in Java code.

Using Flux Workflow

This guide uses a previously coded flow chart to demonstrate Flux's workflow capabilities.

  1. Open the Workflow.java file located in doc/quick_start_guides/quick_start_workflow/software_developers. To compile and run the example, set the Java class path to include both the file flux.jar from the Flux installation directory and the JAR files from the lib directory under the Flux installation directory.

  2. Review the code in Workflow.java. Notice which objects require helpers or factories, such as flow charts and engines.

    Notice the Java Action joinPoint. Because this Java Action is set as a join point, all inbound flows must complete before this action will execute. If a flow reaches the join point, execution of the flow will pause until all other inbound flows have also reached the join point.

    Now, note the conditional flows that are added to to joinPoint. These flows are only followed when their conditions are met. For example, the "NUMBER < 34" flow will only be followed if joinPoint generates a number that is less than 34.

    Finally, notice the else flows that are set on each Timer Trigger. An object's else flow is only followed when there are no unconditional flows and none of the conditional flows are satisfied. The else flow is followed when the Timer Trigger's count has expired. In this case, the else flow will be followed when the Timer Trigger has fired 4 times.

  3. Run the Workflow.java example. The console will display lines similar to the following:

              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.

Congratulations, you have used the Flux APIs to implement workflow in Java code!

To learn more about workflow capabilities with Flux, browse to the examples/software_developers directory under the Flux installation directory. This directory holds more examples that go into greater detail on Flux's workflow capabilities. Many references to workflow can also be found in the Flux manual, located in the doc directory under the Flux installation directory.