A macro can be configured to be run on starting System Architect.
This allows execution of the macro from the command line to allow macro execution to be scheduled through Windows Task Scheduler.
Assumptions
The macro must be specified to be loaded through Tools\Macro Projects so that it is loaded.
The macro must be compiled (error free).
The client is responsible for ensuring the macro will handle errors and that a user will be on hand to respond to any user interface presented.
If the macro requires an encyclopedia to be open then it must either open one through Application.OpenEncyclopediaUsing* or a default encyclopedia should be configured, for instance through the -encyclopedia connection_name(ency_name) command line switch.
If work is to be performed on a number of encyclopedias then the macro can open them in sequence.
System Architect should shut down after running the macro.
Command line parameters
The following command lines (to be specified after the System Architect executable – for example, ..\sa2001.exe -command) are supported – these are not case sensitive.
-ExecuteMacroOnStart project.module.routine
where the elements of the macro identification are not case sensitive.
-ExecuteMacroOnStartArg string
where string will be supplied as an argument (parameter) to the macro. The macro is then responsible for processing it.
In the event of failure to process the execution, such as not finding the macro or the macro is not executable due to a compilation error, this message is logged.
"ValidateMacro returned code: message", where message would be one of the following messages:
"No project of that name exists"
"No module of that name exists"
"No procedure of that name exists"
"Unable to compile the project"
"No permission to execute that macro exists"
- this refers to role based access control permissions
"The string passed in is incorrectly formatted"
"There was an unknown error"
On success
"ValidateMacro returned 0: Ok" will be logged.
"ExecuteMacro returned 0" will be logged.
Automation considerations
It is important to remember that if the macro is to be run unattended then it should not be presenting user interface dialogs or message boxes to report errors.