Manage Publish and Ad hoc Actions

You can add various actions to the project items available in the project hierarchy:
tdm42
You can add various actions to the project items available in the project hierarchy:
  • The 
    Ad hoc action
     type can be executed whenever you want.
  • The 
    Pre-publish action
     type is executed before the publish. Use it, for example, to clear specified tables.
  • The 
    Post-publish action
     type is executed after the publish. Use it, for example, to update some columns using SQL.
You can create actions for the following 
Code Types
:
  •  
    DDL
     
     
    — Executes valid SQL and DDL (Data Definition Language) against a specific profile.
  •  
    SQL  
    — Executes valid SQL against a specific profile.
  •  
    Export
     — Stores an Oracle export in the repository and you can import it as required.
  •  
    Host  
    — Calls a specific external program. Can run synchronously or asynchronously.
  •  
    Javelin  
    — Runs an external Javelin script. Can run synchronously or asynchronously.
Add an Action
  1. Open the Datamaker UI and click 
    Projects, Project Manager
     in the main menu.
  2. Right-click the project manager item to which you want to add actions, and click 
    Maintain actions
    .
    Note:
     Actions that you define become available to other items lower down the tree structure. For example, if you create a Post-Publish action at the 
    Version
     level, all the test cases for that version execute the action after each publish.
    The 
    Actions 
    dialog opens.
  3. Click the plus icon and then click 
    Yes
    .
  4. Select the code type from the
     Code Type
     drop-down list, and click the tick mark icon.
  5. Enter a name and description for the action.
    Note:
     We strongly recommend not to create any actions with duplicate names in Datamaker after the TDM Portal installation. TDM Portal installation renames the duplicate action names to avoid any possible errors. TDM Portal does not allow duplicate action names.
  6. Enter other appropriate information in the actions dialog and save your changes.
  7. The action is added under the selected item in the tree structure.
  8. To access the action for any item, right-click the selected item, and click 
    All available Actions
     from the context menu.
    All actions applicable to the selected item are displayed.
  9. Click the required action to run the action.
Run External Processes Synchronously (Host, Javelin) 
By default, DataMaker runs actions asynchronously and does not wait. When running external action types (such as Host or Javelin) asynchronously this means that actions do not return results back to DataMaker. It is therefore possible that the job finishes before the action completes.
You have the option to run actions of type Host and Javelin synchronously. 
  1. Right-click the action and choose 
    Edit 
    name
     Action
    .
  2. Enable the 
    Synchronous Call
     option. 
  3. Specify the 
    Time to Wait
     before the action reports back its result and DataMaker starts the next action.
    •  
       
      n
       
       — Waits n seconds before returning the result.
    •  
      -1
       — Runs the first action until completion before starting the next action.
    •  
      0
       — Runs actions asynchronously. Datamaker does not wait for a result (default).
  4. Specify whether to
     Terminate on Timeout
    , that is, what to do if the action runs longer than the Time to Wait.
    •  
      Enabled
       — Datamaker terminates the timed-out process and returns a failure.
    •  
      Disabled 
      — Datamaker carries on and considers the action successful even if it has not completed.
Examples
  •  
    Update email address
    You can define a post-publish action of code type SQL that updates email addresses. You can use the following code to update the email address:
    update people set email=first_name||'.'||last_name||'@company.com'
     
  •  
    Invoke a program
    You can define an ad hoc action of code type Host that invokes Internet Explorer and displays a website. You can use the following program call:
    "c:\program files\internet explorer\iexplorer.exe"http://www.ca.com
     
  •  
    Include substitution variables (Post-publish Actions only)
    You can also include any predefined substitution variables in the body of Post-publish Actions; for example,
    C:\gts\creord\double\loadup.bat\ ~OracleSID~ ~LoadSchema~
    When you execute the Post-publish Action, you are prompted for the variable values.