Quick Start Guide: Workflow for End Users

VERSION 4 Published

Created on: 30-Jul-2007 17:56 by flux - Last Modified:  26-Feb-2008 16:11 by Guest

Workflow for End Users

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 take you through the steps involved in modeling jobs using Flux's advanced workflow capabilities. The Flux Designer allows you to
choose from a list of flow conditions which gives you the capability of following a certain flow only if the condition is satisfied.

To use Flux's workflow capabilities:

First, run the Flux Designer, browse to the "flux-designer" batch or shell file, depending on the platform you are currently running Flux with, located within your Flux installation directory. For Windows users, you can run the Flux Designer via the start menu by selecting the "Flux Designer" tab, located under the Flux tab within your start menu.

http://www.fluxcorp.com/images/kb/DesignerStart.jpg

Once inside the Flux Designer, click the "Open Project" option within the "File" menu, located at the top of the designer. Within the "Open" window that appears, browse to your Flux installation directory, and "doc/quick_start_guides/quick_start_workflow/end_users/" directory. Open the "fluxproject.fpr" file located within this directory.

Using the Flux Designer, open the "Workflow" flow chart within the "fluxproject.fpr" project. This flow chart models various flows while maneuvering and modifying files.

http://www.fluxcorp.com/images/kb/Workflow.jpg

The first part of the flow chart displays the behavior and benefits of using join points. The Console Action "Join Point – Created and Copied" is configured to be a join point and wait for the necessary tasks to be completed before the flow chart can move on. In this case, the "File Create Action" creates three files in the "CreatedFiles" directory, which will also be created within the "doc/quick_start_guides/quick_start_workflow/end_users" directory. Once all three files are created, a signal is sent to the "Timeout Action" Delay Trigger. This is done by editing the signals sent out by the flow. You can see and edit the signals by right clicking the flow between "File Create Action" and "Files Created" and selecting "Edit signals to raise".

http://www.fluxcorp.com/images/kb/FileCreate.jpg

Since the "File Copy Action" is dependent on the "File Create Action", a signal is sent to ensure the "File Copy Action" only gets executed if the creation of the three files is successful. This is indicated by right clicking on the flow between "Timeout Action" and "File Copy Action" and selecting "conditions to flow". For this flowchart the "Signal Flow Condition" radio box has been selected and the signal to wait for is "copy". There are many different ways to controls flows in the flow condition editor other than signals such as based on results, an error, or the "else" of a for loop.

http://www.fluxcorp.com/images/kb/Signal.jpg

If the signal is not sent within 10 seconds, the Delay Trigger will fire and the flow chart will be stopped at the join point. If everything goes smoothly and to plan, the "Files Created" Console Action and the "File Copy Action" will flow into the "Join Point - Created and Copied" Console Action, which will in turn trigger that action to fire. You can set a node (an action or trigger in a flowchart) to be a join point by left clicking it to display the action properties pane, and then setting the "Join Point" field to true.

http://www.fluxcorp.com/images/kb/DelayTrigger.jpg

The second part of the flow chart displays the behavior of individually processing files using the Process Action. This functionality is achieved by using a File Exist Trigger to gather all of the newly created files, located within the "CreatedFiles" directory, and putting them into a collection. File triggers and actions require either a pair or a single file criteria entry to set the source and possibly destination for the operation. Once these files are added into a collection, the "File Iterator" For Each Collection Element Action iterates through each file in succession.

http://www.fluxcorp.com/images/kb/FEC.jpg

For the file iterator to see your collection, you will need to map the results of the file exist trigger to input of your iterator. This is achieved by using the runtime data map, which can be displayed by right clicking the flow between "File Exist Trigger" and "File Iterator" and selecting "Edit runtime data map". The runtime data map for this portion of the flow is configured to take the filenames of the found files (RESULT.filename_matches) and map it to the Collection for the follow element. More information on the runtime data map is available in the Flux user manual and in the wiki article Variables in the Flow Context.

http://www.fluxcorp.com/images/kb/RuntimeDataMap.jpg

For each file found by the File Exists Trigger, the File Iterator will pass it to the Java Action node. The Java Action will ask you if you wish to open the text file in an editor or not. If you do, appropriate action will be taken. If you do not, the next file is retrieved. If you are familiar with Java programming, you may look at the Java Action's Listener code by browsing to the "doc/quick_start_guides/quick_start_workflow/end_users" directory, under your Flux installation directory, and view the "Prompt.java" file. Once all of the files within the collection are iterated through, the File Delete Action, "Cleaner", deletes all the files inside the "CreatedFiles" directory and the flow chart is completed.

http://www.fluxcorp.com/images/kb/JavaAction.jpg

To see the flowchart in action, export it to a Flux engine. To create an engine, open the "start-unsecured-flux-engine" batch or shell file, depending on the platform you are running Flux with, located within your Flux installation directory. For Windows users, you can use the "Start unsecured engine" option within the start menu, under the Flux and Flux Engine tabs, to create and run a Flux engine.

http://www.fluxcorp.com/images/kb/StartUnsecure.jpg

Once your Flux engine is running, navigate to the "Export to Remote Flux Engine" menu option located in the "Export" menu at the top of the Designer. Select the option and click the "OK" button within the window that appears. Watch the console your engine is currently running on and you will see the Console Action's messages printed to the screen. When prompted to edit the file simply input "y" for yes, or "n" for no. Once the flow chart is complete the "Cleaner" action will delete all files in the "CreatedFiles" directory and flow into the "Flow Chart Complete" Console Action where a message is printed to the console and the flow chart completes.

http://www.fluxcorp.com/images/kb/ExportWorkFlow.jpg

Congratulations, you have used Flux's workflow capabilities to process text files. For more information on workflow, or the actions or triggers involved in this flow chart, browse to the "examples/end_users/" directory under your Flux installation directory. The examples in this directory will provide you with a detailed description on how to configure and use these aspects of Flux. More information is also available in the "End Users" manual, located within the "doc" directory also under your Flux installation directory.

Once this guide is completed, you can shutdown your Flux engine, run the "shut-down-unsecured-flux-engine" batch or shell file within your Flux installation directory, depending upon which platform you are running Flux on.

http://www.fluxcorp.com/images/kb/ShutdownEngine.jpg
Average User Rating
(0 ratings)




There are no comments on this document