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.
<project name="Multiple Modules" mainModule="Main" version="1.0"> <description></description> <module name="Main" dependsOn="First,Second"> <print> <![CDATA[Main module printing]]> </print> </module> <module name="First" if="FirstOrSecond eq 1"> <print> <![CDATA[First half printing]]> </print> </module> <module name="Second" if="FirstOrSecond eq 2"> <print> <![CDATA[Second half printing]]> </print> </module> <variable name="FirstOrSecond" value="1" /> </project>