Global Variables

If you have been going through the various sections of the documentation and following along with some of the examples shown, you should now be familiar with the idea that both triggers and modules can take a variety of input parameters. For those with many job definitions, some that have some type of close or direct relationship to each other, you will find that you may be using the same settings for various parameters repeatedly. If so, this is one of the keys ways you want to take advantage of the Global Variables feature.

The global-variables feature can be managed by clicked on the Globals button you can see right on the main toolbar of the manager application. The first time you open this, you will see an empty looking screen. To try this feature out, click the Add button you see at the top of the globals window. You will now be prompted to create a new global variable. The first step to defining a global variable is to give it a unique name. Enter a name such as MonitorAddress. In the value field, enter one or more email addresses you have access to. If you enter more than one email address, just separate each address with a comma before adding the next in the value field. And finally, we recommend always putting a short description of what this will be used for. In our example we might put the text “All of the email addresses we want to send monitor messages to”. Click the OK button to save this and you should now see it in the list of defined global variables.

Now we can try out using our globally defined value. Previously we created an example job called “Cleanup old temp files”. Locate that job and open its job definition. Once you have done that, we want to add a new step to the job by clicking the New Step button on the toolbar above the steps grid. For the module, pick [Email] Send and set the name to “Send monitor email”. When you get to the list of parameters, notice how there are two small buttons between the parameter name and the control where you can change the parameters value. The first button is the information button. When you click on this, a more detailed description of what that parameter is for is shown. The next button is the assignment button. Clicking on this, you will see the window for selecting a global variable assignment.

To do this, first assign the SMTP Connection to the connection you defined in the previous section. If you followed the steps, it should be named GeneralSMTP. Then go to the To Email parameter, which is the first listed entry for the send email module. Click the assignment button and you will see the list of global variables you have created so far. There will be some other items after your global variables, but we are going to skip over that for now. Find the global variable you named as MonitorAddress and double-click on it to select and assign it. Now you see that the appearance of the value for your first parameter has changed a bit and is showing the value that you entered into the global variable. Next assign your Subject parameter, set it to “Monitoring temp file cleanup”. For your Message parameter, set it to “We just cleaned up the temp files folder.”. The remaining parameters you can leave blank and click the Save button on the step editor.

Now if you have defined all your settings correctly, try running the Cleanup old temp files job manually and when it is finished, it should send you the email message you just defined in the new step you just created.