Chapter 8 Extended Model Definitions Reference Guide


Commands and tasks

The Commands category allows you to define generation commands. The generation commands can be executed at the end of the generation, after the generation of all files.

The text defining the code of the command is written using the Generation Template Language. (GTL). It uses environment variables that may correspond to executables. You can also use macros within your commands.

For more information on the GTL, see chapter Generation Reference Guide.

All commands written in the Commands category are available after creation in the Tasks page of the Generation dialog box where they can be executed at the end of the generation. A task is a list of commands to be executed after generation. Each task appears in the Tasks page of the Generation dialog box beside the name of the extended model definition. You can select them and use the arrows to set a generation order among these lists of commands.

A command entry that is not referenced in a task entry cannot be executed during generation. When a task is selected in the Tasks page of the Generation dialog box, the commands included in the task are retrieved and the template associated with the command is evaluated and executed.

In the following example, three tasks are defined in the WebLogic extended model definition; the other tasks proceed from the object language of the model (Java):


Creating a command

You must create commands before tasks.

Steps To create a command:

  1. Right-click the Commands category and select New in the contextual menu.

    A new command is created.
  2. Type a name in the Name box.
  3. <optional> Type a comment in the Comment box.
  4. Type the command code in the empty text area using the different tools available in the toolbar.
  5. Click Apply.

Creating a task

Steps To create a task:

  1. Right-click the Tasks category and select New in the contextual menu.

    A new task is created.
  2. Type a name in the Name box.
  3. <optional> Type a comment in the Comment box.

    The task comment appears in the Generation dialog box.
  4. Click the Add Commands tool.

    The Add Command dialog box appears.
  5. Select one or several commands and click OK.

    The commands appear in the list of commands.
  6. Use the arrows below the list to define an order in the list of commands.
  7. Click Apply.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.