Looking for an example project to get you started?
- Posts: 13
- Joined: Fri May 08, 2009 8:59 am
In GoAnywhere you can specify multiple modules in a project. Some of these modules could be used for error processing while others can be used for organizing tasks. In the example below I have specified a project level variable called FirstOrSecond. If that variable is set to a 1 the "First" module will execute. If it is set to a 2 the "Second" module will execute.
When GoAnywhere executes this project by default it will begin with the Main module. On the Main module I've added a couple modules to the Depends On attribute which are separated by a comma. Since the Main module depends on First and Second to run it will then pass control to the First module. I added a Execute Only If condition on that module to say to run only when the variable is set to a 1. I've also added conditional logic to the Second module to run only if it's a 2.
In the example below the "First" module will execute because the variable is set to a 1. The "Second" module will be skipped and then the "Main" module will finish execution. For demonstration purposes each module only prints some static text.
Code: Select all
<project name="Multiple Modules" mainModule="Main" version="1.0">
<module name="Main" dependsOn="First,Second">
<![CDATA[Main module printing]]>
<module name="First" if="FirstOrSecond eq 1">
<![CDATA[First half printing]]>
<module name="Second" if="FirstOrSecond eq 2">
<![CDATA[Second half printing]]>
<variable name="FirstOrSecond" value="1" />
With this in place I can easily override the project variable at run time (via GoAnywhere's scheduler, Execute Advanced screen, RUNPROJECT command, etc) and determine what tasks will be executed.
Return to “Example Projects”