Create and Manage Publish and Table Actions

The CA TDM Portal lets you create Publish and Table actions, that you can execute before or after data generation.
tdm47
The CA TDM Portal lets you create
Publish
and
Table
actions, that you can execute before or after data generation.
  • Pre-publish actions
    are actions that you want to execute before you perform the publish. For example, by creating a pre-publish action, you can clear down some specified columns.
  • Post-publish actions
    are actions that you want to execute after you perform the publish. For example, by creating a post-publish action you can update some columns using SQL.
You cannot create, edit or execute Actions of type
HOST
or
WORKFLOW
 from within TDM Portal in Docker. For more information, see TDM Portal REST ActionService container.
Enable HOST Actions
HOST actions can manipulate files and folders and execute commands with system level privileges on the CA TDM server. When users try to run a job that contains a HOST action, the back-end returns the following error by default:
HOST actions are not enabled. Contact your admin.
To allow authorized CA TDM users to run HOST actions, the CA TDM administrator must enable this feature.
  1. Navigate to the directory where you installed the CA TDM Portal, and open the "conf/" sub-directory.
  2. Locate and open the 
    application.properties
     file in a text editor.
  3. Enable the execution of host actions by setting the following flag to true.
    EnableHostActions={true|false}Default:
     false
    • false
      — specifies that users cannot run HOST actions. Users can still create HOST actions from the CA TDM Portal, and are still able to see HOST actions created for the job in the list.
    • true
      — specifies that users can run HOST actions with system level privileges.
  4. Restart the CA TDM service.
Create an Action
  1. Select a project and version from the Project drop-down list available in the portal header. Optionally, click the gear icon (next to Project drop-down in the portal header) to search for a specific project. If you want to create a new project, see Create and Edit Projects.
  2. Click Generators in the left pane.
    The Generators page opens and lists the existing generators created for the selected project and version. If you want to create a new generator, see Create Data Generator.
  3. Click the generator for which you want to create publish actions.
    The generator details page opens.
  4. Click the Actions button.
    The Actions page opens.
  5. Select action type from Actions drop-down. Following are the available options:
    • Publish
      Select Publish, if you want to execute the action every time you perform publish data generation.
    • Table
      Select Table, if you want to executes the action only when the specified used table is associated in publish data generation.
  6. Click the
    Create Publish Action
    or
    Create Table Action
    button based on the action type you selected.
    The
    New Publish Action
    or
    New Table Action
    page opens .
  7. Enter the following information:
    • Name
      Specifies the name of the action you want to create.
    • Description
      Specifies the brief description of the action you want to create.
  8. Select the Code Type. Following are the available options:
    • Host
      To run an actual program on the TDM server.
    • Javelin
      To create and execute Javelin actions for a generator in the CA TDM Portal. For more information, see Using Workflows in CA TDM Portal.
    • SQL
      To execute an SQL statement in the environment into which you publish data.
    • REST
      To perform a call to a REST API endpoint.
  9. (
    Table
    Action only) From the Table drop-down list, select the table on which you want to perform the Action.
  10. (Code Type
    Host
    ) Specify the following:
    • Command
      Command to execute on the host machine as system user.
      For example:
      "cmd
      /c shutdown -s"
      to shutdown computer after publishing.
    • Wait for Completion
      Specifies whether you want to run the action of type Host synchronously. If so, enable this option and specify a value in the
      Execution Timeout
      field. The
      Execution Timeout
      field specifies the time (in seconds) for which the Portal waits for the completion of the action. If the action does not complete before the timeout limit, it is terminated and a failure is returned for the action. If the value of timeout field is greater than 0, the action is considered as synchronous. For all other cases (including not providing the value), the action is considered as asynchronous.
      Additionally, in the previous version (3.8) of the CA TDM Portal, all the defined actions were synchronous. Now with the presence of the
      Wait for Completion
      field in the 4.0 version, all the actions coming from the 3.8 version behave in an asynchronous manner in 4.0. By default, this option is not selected. If you want to run your 3.8 action in a synchronous manner, you can select the
      Wait for Completion
      option and specify the required timeout value in the
      Execution Timeout
      field.
       This functionality is applicable only for the action of type Host. For any other action type, these options remain empty.
    • Success Required
      Specifies whether invoking the program is required or optional. Select this check-box, if invoking the specified program is mandatory. If invoking the program fails, the publish will not be completed. 
  11. (Code Type
    SQL
    ) Specify the following:
    • DB Connection
      This is required if the action type is Publish only. Specifies the Database on which you want to execute the SQL. Select a database from the drop-down list.
    • Use
      You can use either Stored SQL or Direct Code to execute the publish action. Specify one of the following as required:
      • Stored SQL
        Select the stored SQL from the drop-down list.
      • Direct Code
        Enter the code required to execute the SQL. 
    • Success Required
      Specifies whether successful execution of the SQL is required. If you select this check-box, and execution of the SQL fails, the publish is not completed.
    • Success Criteria
      Specifies the criteria to meet for successful execution of SQL. Select one of the following two options and specify the criteria as required:
      • Results
      • Row Count
  12. (Code Type
    REST
    ) Specify the following:
    • REST Action URL
      Full REST API URL. For example: http://my.action.com
    • Action Secret
      This value acts as a security measure for the target API URL, and its contents are concealed as you type. Check what security protection is in place on the target API - if there is no such security protection on the target API, this value is not used.
      This value appears in the REST API body that TDM generates as a
      hashed
      value (with the hashing algorithm sha-256).
      For example, if you enter 'marmite' in the
      Action Secret
      field, the value of parameter
      secret
      in the API body is
      7362DEDB2123ABABBD1446A395A7235DE3DFADF91F173961DABDE8FECFDBFC1C
      .
    • Variables for the Action
      Enter any substitution variables you want to use in your TDM commands, separated with commas. For example:
      CDATE, my_variable
      client_name
      another_variable
      .
      Enter all variables
      without
      the tilda (~) symbol before and after.
      These variables appear in the parameters section of the API body that TDM generates, with their associated default values. For more information, see Create and Manage Variables.
    • Identity Delegation
      Choose whether the user that performs the Action is you, or a
      Custom User
      . For a Custom User, enter User Name and Password fields.
  13. Select the Execute Action to determine whether the action is a Pre-Publish or Post-Publish action. Following are the available options:
    • Before (Pre-Publish)
      Specifies the action to complete before the publishing starts.
    • After (Post-Publish)
      Specifies the action to perform after the publishing completes.
  14. Click
    Save
    .
    The publish action is successfully created. The created publish actions for executing Before and After are added to Pre Publish Actions and Post Publish Actions respectively on the Actions page.
    Repeat the above steps to create more publish actions.
Re-order Actions
  1. Select a project and version from the Project drop-down list available in the portal header. Optionally, click the gear icon (next to Project drop-down in the portal header) to search for a specific project.
  2. Click Generators in the left pane.
    The Generators page opens and lists the existing generators created for the selected project and version.
  3. Click the generator to see the existing actions.
    The generator details page opens.
  4. Select Publish or Table from Actions drop-down to see the respective type of existing actions.
    The Actions page opens and lists the Publish Actions or Table Actions based on the action type you selected.
  5. Identify the actions that you want to re-order and click the upward arrow or the downward arrow to move the respective action up or down. The actions are executed in the order they appear in the list.
Execute an Action
  1. Select a project and version from the Project drop-down list available in the portal header. Optionally, click the gear icon (next to Project drop-down in the portal header) to search for a specific project.
  2. Click Generators in the left pane.
    The Generators page opens and lists the existing generators created for the selected project and version.
  3. Click the generator to see the existing publish actions.
    The generator details page opens.
  4. Select Publish or Table from Actions drop-down to see the respective type of existing actions.
    The Actions page opens and lists the Publish Actions or Table Actions based on the action type you selected.
    Note:
    For the Publish actions of the type Host, the
    Wait for Completion
    and
    Execution Timeout
    options are also applicable. Additionally, you can specify a different value in the
    Execution Timeout
    field and execute your action using that value. This ability lets you execute your publish actions with different timeout values. You can then edit your action if you want to change the execution timeout value based on your testing. The new timeout value is not persistent; that is, you cannot save this value to override the original value, which you specified at the time of creating your action.
  5. Identify and click the forward arrow (>) in the row that corresponds to the action that you want to execute.
    Executes the respective Action and shows a message with the success or failure information.
Edit an Action
  1. Select a project and version from the Project drop-down list available in the portal header. Optionally, click the gear icon (next to Project drop-down in the portal header) to search for a specific project.
  2. Click Generators in the left pane.
    The Generators page opens and lists the existing generators created for the selected project and version.
  3. Click the generator to see the existing publish actions.
    The generator details page opens.
  4. Select Publish or Table from Actions drop-down to see the respective type of existing actions.
    The Actions page opens and lists the existing Publish Actions or Table Actions based on the action type you selected.
  5. Identify and click the action that you want to edit.
    Edit Publish Action or Table Action page opens based on the action type.
  6. Modify the details as necessary and click Save. You can edit all the details except the Code Type.
    The action is successfully modified.
Delete an Action
  1. Select a project and version from the Project drop-down list available in the portal header. Optionally, click the gear icon (next to Project drop-down in the portal header) to search for a specific project.
  2. Click Generators in the left pane.
    The Generators page opens and lists the existing generators created for the selected project and version.
  3. Click the generator to see the existing publish actions.
    The generator details page opens.
  4. Select Publish or Table from Actions drop-down to see the respective type of existing actions.
    The Actions page opens and lists the existing Publish Actions or Table Actions based on the action type you selected.
  5. Identify and click the cross icon (X) in the row that corresponds to the action that you want to delete.
    A confirmation dialog opens.
  6. Click Delete to proceed with the delete process.
    A message appears after the successful deletion of the action.
  7. Review the actions list to verify that the deleted action is no longer available in the table.
    You have successfully deleted the publish action.