Job Scheduling 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 using the Flux Designer to schedule jobs. Within the Designer are various triggers, however, when setting up an action to fire at certain times, the Timer Trigger is best suited. For this example on how to use Flux's job scheduling capabilities, a pre-existing flow chart is used. From this flow chart you may create and run your own task with a customized schedule.
To learn how to use Flux's job scheduling feature:
- First, run the Flux Designer browse to and run the "flux-designer" batch, shell, or executable 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.
- 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 "/doc/quick_start_guides/quick_start_job_scheduling/end_users/" directory. Open the "fluxproject.fpr" file located within this directory.
- Using the Flux Designer, open the "Job Scheduling" flow chart within the "fluxproject.fpr" project. This flow chart begins by waiting for a Timer Trigger to fire. Once the Timer Trigger fires, a Process Action will execute. This Process Action opens the "README.txt" file, located inside your Flux installation directory, with the program "notepad". If you do not have notepad installed on your system, edit the Process Action's "Command" action property to execute a basic text editor on your local file system. Be sure to incorporate the absolute path to the executable, batch, or shell file. Ex.) C:\flux-*-*-*\Flux Designer.exe, where the "*" is the version number of your currently installed Flux software. This command would open the Flux Designer if placed into the Process Action's "Command" action Property.
- As of now, this specific Timer Trigger fires every five seconds after the flow chart is executed, however, the "Count" action property for the Timer Trigger is set to 1, meaning this trigger will fire only once. To view this behavior we must, first, start a Flux engine.
- You can view and edit specific settings for the timer trigger by clicking on it to toggle the action properties pane in the right portion of the designer as shown below. For information on what these properties do, see the Flux end-user documentation (docs/flux-user-manual.pdf from your flux root).
- 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.
- 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.
- Once five seconds has elapsed, the README.txt file will open. Once satisfied, close the README.txt file. After viewing the trigger in action, dispose the engine, browse to your Flux installation directory and run the "shut-down-unsecured-flux-engine" batch or shell file depending upon which platform you are currently running Flux from. For Windows users, you can shutdown the engine from the start menu by selecting the "Shut down unsecured engine" option, located under the Flux and Flux Engine tabs.
- Next, view the "business hours" time expression by double clicking it in the "Project View" tab. This will bring up the "Time Expression Editor". This time expression will fire from 8 am to 5pm, every hour, Monday through Friday.
- To view the firing times of this time expression, click the "Test" button located within the "Time Expression Editor". Set the "Number of Test Firings" to 50 and click the "Test" button. Review the results in the "Test Result in Local Time Zone" box.
- When you have finished viewing the results, click the "OK" button on the "Test Time Expression" window. More information on time expressions can be found in the Flux end-user manual (doc/flux-user-manual.pdf from your Flux root) and in the Flux knowledge base located on the web at http://my.fluxcorp.com/community/wiki.
- Now that you are familiar with the "Time Expression Editor", modify the "business hours" time expression to fit your scheduling needs. By un-checking the "Any" column and selecting the editable field of the "Column Value", help instructions will be displayed to the right.
- Once you have a satisfactory time expression, test the time expression and make sure the firing times are correct.
- Once you have confirmed the stability of the time expression, click the "Next >" button, and then the "Finish" button.
- To use the time expression with the Timer Trigger, select the "Timer Trigger" action and highlight its "Time Expression" action property. Click the "..." box that appears to the right of the highlighted field, then the "business hours" time expression within the "Time Expression Editor" window.
- Once you have your time expression selected, click the "OK" button to set it to your timer trigger. If you require the Timer Trigger to fire more than once, select the Timer Trigger's "Count" action property and set it to "-1", which means the trigger may fire an infinite amount of times. If you need more help dealing with time expressions before creating your own, navigate to the "business_calendar" end user's example for another look at creating time expressions. This example can be found in the "examples/end_users/business_calendar" directory within your Flux installation directory.
- Now that your time expression is set, create and start a Flux engine, and export the flow chart to the running engine.
- Congratulations, you have created and run your own custom Time Expression using a Flux Timer Trigger within the Flux Designer. This Timer Trigger can be appended to the top of any Flow Chart to incorporate a schedule with the tasks that will be performed. For more information on job scheduling with the Flux Designer, refer to the "examples/end_users/" directory under your Flux installation directory. The "end_users" directory houses more scheduling examples that go into greater detail in explaining the feature. For more information on Crons, Timer Triggers, or job scheduling, refer to the End_Users Manual located within the "doc" directory 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.