Batch Processing
The Composition Environment Command Line Tool (CECLT) allows batch processing. One of the ways to do this is to store the sequence of commands you want to execute in a text file. At start up of the CECLT, it processes this command file and terminates itself when it is finished.
The content of a sample command file is listed below. It shows how you perform the various steps from loading a development configuration and development component (DC) build up to the SCA creation one after the other. The first command spool has the effect that the output is written to a file. The second command exec has the effect that a batch file is executed. Here we assume that the batch file sync.bat synchronizes the data from a repository, which is used in one of the later commands. This shows how you can embed other programs or OS commands into the CECLT.
In our example, the commands are stored in a file named nwcecommands.txt.
For the batch processing the CECLT tool is launched as follows:
nwcetool.bat -f nwcecommands.txt
Here is the context of nwcecommands.txt:
# comments start with a character # at the beginning of the line spool output.txt exec “sync.bat” loadconfig -l "C:\nwds\ws.jdi\LocalDevelopment" -a "C:\nwds\eclipse\plugins\com.sap.tc.ap\comp" listavailabledc listusingdcs -n test -v mycompany.com -c MyComponents listuseddcs -n javadc -v mycompany.com -c MyComponents buildalldcs listbuildresults -f buildres.html packdcs -c MyComponents -b default -i doc exportforassembly -c MyComponents -b default -f c:\packing packsca -n MyComponents -v mycompany.com -l mylocation -c 20061025120000 -r 1.0 -sp 1 -pl 1 -da "c:\packing\deployarchives" -ba "c:\packing\buildarchives" -includingsubdirs c:\packing\mycomponents.sca |
A certain workflow has been established using this command file. Now you can execute this file at a certain point in time without launching the CECLT manually. If you want to start the command sequence in the evening at about 22:00, you can schedule that your OS launches the execution of the command file at this point in time. The following example uses the atcommand of Windows OS for scheduling. On Unix/Linux, cron can be used instead of at for the same purpose.
at 22:00: C:\nwds\eclipse\tools\nwcetool.bat –f C:\nwds\eclipse\tools\nwcetool\nwcecommands.txt
Another way to use the CECLT for batch processing is to call the CECLT from within a batch file or a shell script. In this context, when the CECLT is launched, you can use the option to pass a command to it. In the example below, the help command is passed. The command to be executed is the argument of option –c.
nwcetool.bat -c “help”
You can also pass several commands in this way. The commands are separated by a semicolon.
nwcetool.bat -c "help;help exec"
In both examples, the CECLT continues in interactive mode once the passed commands have been executed. To enforce that the tool terminates after the execution of the passed commands, use the –e option.
nwcetool.bat -c "help;help exec" –e
In case a command file is passed via an option –f, by default, the tool terminates after the commands are executed.