User Tools

Site Tools


Creating Template Batch Files

EASA drives software applications in their batch mode. Therefore, pre-existing batch input files must be available for an EASAP to work, and these files may need to be modified by an author to work properly with an EASAP. Batch input files only need to be modified if they contain settings or commands that are affected or dependent on user inputs.


Note: All batch files, modified or not, need to be uploaded onto the EASA Server and into the EASAP folder using the Files selection under the Authoring menu or the Files tab in EASAP Builder.


Once you have determined that a batch file requires modification, then there are two steps involved:

  1. Insert Delimited Object References into the batch file using the Template Editor or the text editor of your choice.
  2. Create a REPLACEMENT object identifying the batch file to be targeted for replacement of DORs with actual object values when the EASAP executes.

Editing Batch Files

To create Templates from existing batch files, you will need to edit the files by inserting DORs at the appropriate locations within these files. There are two basic usages of DORs within batch files:

  1. Direct replacement of input parameter values or settings based on user inputs, and
  2. Place holders for complete command lines that are dependent on user inputs.

Note: When editing template batch files, you will need to replace any “full paths” with “local paths”, for example replace “C:\Test\run.bat” with “.\run.bat”.


Template Editor

EASA contains a tool called the Template Editor that is designed to simplify the process of adding DORs into text files, such as template batch files. In addition to adding DORs to files, the Template Editor can also be used like a text editor to type in other changes to the file. The Template Editor can also be used to add DORs into files used in the presentation of results in reports (See “Building a Report” on page 301]] for more details).

The Template Editor is accessed by clicking on one of the Open Template Editor buttons (open_template_editor.jpg) or by selecting Template Editor under the Authoring Menu, and then by clicking on one of the Edit buttons () within the ‘Template Files’ table. When you click on an Edit button, the Template Editor will appear in a separate window as shown below.

Basic functions expected within a text file editor are present in the form of both menu picks under the File and Edit menus and as buttons on the editor’s toolbar. Descriptions of the individual buttons on the toolbar are provided in Table 12.2.

IconNameFunction
Save FileSaves current version of the file. [Ctrl-S]
Refresh FileRefreshes the display of DORs in the file.
UndoUn-does last action. Multiple undo’s allowed.
RedoRe-does last action. Multiple redo’s allowed.
CutCuts the selected text. [Ctrl-X]
CopyCopies the selected text. [Ctrl-C]
PastePastes the previously cut or copied text. [Ctrl-V]
FindFinds typed in text within file. [Ctrl-F]
Select DORsSelects all DORs containing typed text within file.
Goto Line NumberPositions cursor at beginning of typed line number. [Ctrl-G]
Filter DOR ListShows only objects in DOR List matching search string entered
Reset DOR ListResets display in DOR List to all available objects
Insert DORInserts a DOR in the selected file location for the selected object in the DOR List
Remove DORRemoves the selected DOR from the file and replaces it with the original value
DOR Name ViewDisplays DORs as bold colored object names
DOR Value ViewDisplays DORs as bold colored values of the objects
DOR Text ViewDisplays the full syntax of DORs in the file
Format DORSets the number format for the selected DOR

Some important menu functions not provided in the toolbar are:

  • Reload the last saved version of the DOR List in EASAP Builder under the File menu [Ctrl-R] NOTE: Allows updating of DOR List from recently saved EASAP Builder session without Template Editor restart.
  • Create Shortcut to file on your desktop under the File menu
  • Save Options → Windows or Unix under the File menu
  • Exit under the File menu [Ctrl-Q]
  • Format Groups … to create predefined number formats under the Edit menu

Note: The Save function always writes over the previous version of the file.


Adding a DOR The main purpose of the Template Editor is to add DORs to text files. The process for adding a DOR is as follows:

  1. With your mouse, highlight the characters in the file to be replaced by a DOR.
  2. In the DOR List frame, highlight the object name to be inserted as the DOR, and then click on the Insert DOR button () in the toolbar or simply double-click on the object name.
  3. If the DOR has units associated with it, select the appropriate unit in the pull-down list labeled Units: in the toolbar.

Note: For certain types of objects, e.g. Compute objects, their Unit Group parameter must be set to a Dimensional Group, in order for a unit to be specified in a DOR of the object.


  • If the DOR has a numerical value and you would like to format the number, click on the Format DOR button () in the toolbar and then set the format on the form that appears (See the next section for more details).
  • Formatting Numbers in DORs In the Template Editor, there are a few methods for formatting the number of a numerical DOR. First, when you select a DOR and then click on the Format DOR button, a form appears as shown in Figure 12.10. On this form, you first select the type of number format to use on the DOR from four choices:
  • No Format
  • Single Format - where you set the type (General, Number, Scientific, Integer), width and decimal places of the number.
  • Group Format - where you select an existing number format group that has been defined using the Format Groups selection under the Edit menu
  • Custom Format where you type in number format syntax as described in Formatting Numbers in DORs.

EASA Text File Editor

The EASA Text File Editor is a basic file editor that is accessed by clicking on one of the Edit buttons () within the ‘Current Files’ table found on the Files page under the Authoring Menu. This text editor can be used as an alternative to the Template Editor. However, you will need to take care to type in the proper syntax for any DORs inserted into a file. When you click on an Edit button, the editor will appear in a separate window as shown below.

Basic functions expected within a text file editor are present in the form of both menu picks under the File and Edit menus and as buttons on the editor’s toolbar. Descriptions of the individual buttons on the toolbar are provided in the table below.

IconNameFunction
Save FileSaves current version of the file. [Ctrl-S]
Reload FileReloads the last saved version of the file. [Ctrl-R]
UndoUn-does last action. Multiple undo’s allowed. [Ctrl-Z]
RedoRe-does last action. Multiple redo’s allowed. [Ctrl-Y]
DeleteDeletes the selected text from the file. [Delete]
CutCuts the selected text. [Ctrl-X]
CopyCopies the selected text. [Ctrl-C]
PastePastes the previously cut or copied text. [Ctrl-V]
FindFinds typed in text within file. Not case sensitive. [Ctrl-F]
ReplaceFinds typed in text and allows found text to be replaced with new text. [Ctrl-H]

Toolbar buttons The only menu functions not provided in the toolbar are:

  • Exit under the File menu [Ctrl-Q]
  • Save Options → Windows or Unix under the File menu
  • Select All under the Edit menu [Ctrl-A]
  • Word Wrap toggle under the Edit menu

Note: The Save function always writes over the previous version of the file.


Example: Direct Value Replacement

In this example, a batch file will be modified by inserting two DORs. Figure 12.12 shows the relevant section of the file prior to modification. The process of editing the batch file and transforming it into a template file is outlined in the following steps:

  • Upload the batch file onto the EASA Server using the Files selection under the Authoring menu.
  • Open the batch file in the EASA Text File Editor by selecting the file’s Edit button () in the ‘Current Files’ table.
  • In the EASA Text File Editor, replace the ‘1.1’ in the command line ‘D1 = 1.1’ with the DOR, %D1%.
  • Then, replace the ‘0.3’ in the command line ‘D2 = 0.3’ with the DOR, %D2%.

  • Finally, save the changes by typing Ctrl-S and then exit the editor. The new ‘template’ batch file will appear as shown below.