Sub Flow Chart Example Flow Chart

NOTE: We do not recommend using the Sub Flow Chart Action. Instead, we recommend using the Flow Chart Action, which provides the same functionality but does not include many of the risks inherent in the Sub Flow Chart Action. Refer to the Sub Flow Chart Action description page for more information.

Sub Flow Chart Example Flow Chart

This example displays the properties, usage, and behavior of the sub flow chart action. The sub flow chart action executes a flow chart as a sub flow chart, that is, as a child of the current flow chart. Once executed, the child flow chart can either run synchronously or asynchronously to the parent flow chart depending on the situation it is used in. For a detailed description of the sub flow chart action, refer to the "Sub Flow Chart Action" section in the End Users Manual.

Running this Example from the XML File

If you wish to run this example using an existing flow chart, create a new flow chart and select the “Import one flow chart from XML file:” check box. Then click the "Folder Browse" icon to browse for the “.ffc” file to import. Select the flow chart located in the same directory as this example and click “Open” then click the "OK" button. See Figure 1 below.

Figure1: Importing a Flux Flow Chart

Getting Started

To get started, run the Flux Designer. You can start the Designer by running the flux-designer script from your Flux installation directory.

Figure2: Flux Designer Logo
Once you have the Flux Designer running, open the project that is located within the same directory as this example resides in, examples/end_users/sub_flow_chart . To open the project, click the "Browse" icon, browse to the previously mentioned directory, and open the fluxproject.fpr file.

Next, make a new flow chart, either by going to the “file” pull down menu at the top left of the screen and selecting “New”, or by click on the icon  directly below it to bring up the “New” window represented in Figure 3 below. Select the “New Flow Chart” option and click "OK".

Figure3: "New" Options
Name the flow chart “SubFlowChart” and click "OK" .

Creating Actions

Next, create the actions used in the flow chart. Locate the actions and triggers needed within the “Action” and “Trigger” tabs to the left of the drawing canvas as shown in Figure 3 below. Drag the actions listed below in the bulleted list into your drawing canvas and arrange them according to Figure 4 displayed below.

Figure3: "Action" and "Trigger" Tabs
The bulleted list below gives you the following information: The name of the action or trigger you need, the category that the action or trigger is located under, and how many instances are needed for this example.

 “Actions” Tab:

· Action Name: “Console Action” , Category: “Core”, Quantity: 2

· Action Name: "Sub Flow Chart Action", Category: "Core", Quantity: 1

Figure4: Action's Layout

Setting up Flows

Next we need to create the flow from each action and trigger. Use Figure 5 displayed below as a guide to set up the flows for your flow chart. Follow the list of instructions below to create the flows.

  1. Click the blank white space within your drawing canvas.
  2. Click and hold on the action you wish to draw the flow from.

Drag your cursor to the action you wish to draw the flow to and release.

Figure5: Flow Chart Layout

Renaming Actions

Next, let’s give the actions more descriptive names. This will keep us from getting confused on which actions we are dealing with later in the example as well as more descriptive names as a reference. Follow the steps below to edit an action’s name.

To edit an actions name:

Right-Click on the action whose name you wish to edit. The menu shown below in Figure 6 will appear.

Figure6: Editing the Action Name
Click the “Edit action name” option on the drop down menu.

Type in the name you wish to give the action.

Action Names

Use the bulleted list below as a reference to rename your actions.

· “Console Action” to “Start”.

· “Sub Flow Chart Action” to “Child”.

· “Console Action 2” to “End”.

When you have renamed your actions your flow chart should look similar to Figure 7 shown below.

Figure7: Renamed Actions

Editing Action Properties

Console Actions

Now that your flow chart is setup, let's configure the console actions' Message, Postscript, and Runtime Data Map fields. First, we will start with the "Start" console action's Message property. Highlight the "Start" console action by clicking the action within the drawing canvas. The "Console Action" "Action Properties" panel will appear at the right. Double-click the "Message" field within the "Action Properties" panel and a window similar to Figure 8 below will appear.

Figure8: Message Editor

Type into the editor, "Parent Flow Chart has started" as shown above in Figure 8. Make sure that you place a return character at the end of the line by pressing the "Enter" key. This will keep your engine's console organized. When you are finished using the editor, click the "OK" button.

Now, double-click the "Postscript" field. The "Start-Postscript" editor, shown below in Figure 9 will appear. Type into the editor:

Engine engine = flowContext.getEngine();
String version = engine.getVersion().toString();
flowContext.put("VERSION", version);

Figure9: "Start" Console Action's Postscript Editor
Once you are finished editing the "Start" console action's Postscript, click the "OK" button. This Postscript will map the Flux engine version information to the flow context with the name "VERSION". We will use this variable later in the flow chart.

Next, we will need to add a runtime data map to the "End" console action. To do this, first, select the "End" console action within the drawing canvas. The "Console Action" "Action Properties" panel will appear on your screen. Select the "Runtime Data Map" field within the "Action Properties" panel, and then click the  box that appears. Use Figure 10 below as a guide.

Figure10: "End" Console Action's Runtime Data Map

Select the "Add" button located in the runtime data map editor. Edit the data map according to the following information:


Type = Flow Context

Name = END


Type = Action

Name = Message

Use Figure 11 below as a guide.

Figure11: "End" Runtime Data Map Editor

Sub Flow Chart Action 

Now that the console action is configured on the parent flow chart, let's create the child flow chart that will be running using the sub flow chart action. Start by highlighting the "Child" sub flow chart action in your drawing canvas by clicking it. Once highlighted, the action's "Action Properties" panel will appear. Click the "Sub Flow Chart" action property and the highlighted field will be displayed according to Figure 12 shown below.

Figure12: Sub Flow Chart Property
Click the "E" button within the "Sub Flow Chart" field and a Flux Designer, shown below in Figure 13, will appear.

Figure13: Sub Flow Chart Designer
For simplicity, drag a "Console Action" from the "Core" menu, located under the "Action" tab, to the sub flow chart editor's drawing canvas.

Once the console action is placed into the drawing canvas, and the "Action Properties" panel is visible, rename your "Console Action" to "Sub Flow Chart Action".

Next, edit the "Sub Flow Chart Action" action's "Postscript" field to read:

flowContext.put("END", "This flow chart is complete!");

Finally, we will need to edit the runtime data map of the "Sub Flow Chart Action" to use the variable added into the flow context in the "Start" console action of the parent flow chart. Start by highlighting the "Runtime Data Map" property within the "Sub Flow Chart Action" console action's "Action Properties" panel. Click the "Edit"  box and Figure 14 below will appear.

Figure14: Runtime Data Map Editor

Select the "Add" button located in the runtime data map editor. Edit the data map according to the following information:


Type = Flow Context



Type = Action

Name = Message

Refer to Figure 15 below as a guide.

Figure15: Edited Runtime Data Map
When you have finished editing the runtime data map, click the "OK" button.

Once you have completed the above steps, your sub flow chart should be completed and look similar to Figure 16 below. Click the "OK" button within the sub flow chart editor when you are finished.

Figure16: Completed Sub Flow Chart

You should now have a complete, working flow chart. Now, export the flow chart to a Flux engine.

Creating a Flux Engine

Run the start-unsecured-flux-engine script from the Flux installation directory to start an unsecured Flux engine. Next, return to the Flux Designer and move your cursor over the “Flux Engines” tab located to the left of the workspace.

Click the  button at the top of the “Flux Engines” tab and the window shown in Figure 18 below will appear.

Figure18: Job Scheduler Engine Setup
Click on the “Advanced” tab at the top of the “Flux remote engine” window and click .

You will return to the Designer workspace. Look at the “Flux Engines” tab again. The engine you just started should look like Figure 19, shown below.

Figure19: Indicator for running Engine

Running the Flow Chart

Next, export your flow chart to the engine. You can do this step by clicking on the  icon at the top right of the Flux main screen. You may also export a job by clicking on the “Export” menu at the top of the screen and selecting “Export to remote job scheduler engine”. This menu is represented by Figure 19 below. Another way to export your job is by right-clicking on your drawing canvas and selecting the “Export to remote job scheduler engine” option. The menu and option are shown below in Figure 20.

Figure19: Export Menu

Figure20: Drawing Canvas Options
Click  in the window represented by Figure 21 below.

Figure21: Export to Engine
A confirmation window, illustrated below as Figure 22, will appear if the job was successfully exported. Click the  button on the confirmation message. If there is an error message, look over this example carefully, and correct any mistakes made.

Figure22: Successful Export of Job
Once you have exported your flow chart to the Flux engine, you should see the line "Parent Flow Chart has started", followed by the engine's version information, and ended with the line "This flow chart is complete". Use Figure 23 below as a guide.

Figure23: The Flux Engine Console

Once this example is completed, shut down the engine by running the shut-down-unsecured-flux-engine script from the Flux installation directory.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.