Generating SQL Script Files from the Workflow

You must run the workflow before generating the SQL script from it.

To generate the SQL script files from a workflow:

  1. Right-click any node and select Deploy. For this use case, right-click the INSUR_CUST_LTV_SAMPLE BUILD node, and select Selected node and connected node option under Deploy.

    Note:

    For this use case, the predefined workflow codegen_workflow is used.

    The script deployment options are:

    • Selected Node and dependent nodes: This option generates the SQL script for the selected node and all its parent nodes. For example, as shown in Figure 7-3, if the Apply Node is selected, then a script will be generated for these nodes:

      • INSUR_CUST_LTV_SAMPLE BUILD

      • Class Build

      • INSUR_CUST_LTV_SAMPLE APPLY

      • Apply

    • Selected node, dependent nodes and children nodes: This option generates script for the selected node and all its parents and children nodes. For example, in Figure 7-3, if the Apply Node is selected, then a script will be generated for these nodes:

      • INSUR_CUST_LTV_SAMPLE BUILD

      • Class Build

      • INSUR_CUST_LTV_SAMPLE APPLY

      • Apply

      • SCORED_CUSTOMERS

    • Selected nodes and connected nodes: This option generates scripts for the selected node and all the nodes that are connected to the selected node. In this example, as shown in Figure 7-3, if the Apply Node is selected, then a script will be generated for all the nodes that are connected to the Apply node in the workflow.

    Note:

    To generate a script for the entire workflow, you can select all the nodes in the workflow (by clicking all the nodes while pressing Ctrl key simultaneously) and select any of the above three deployment options.

  2. After selecting a Deploy options, the Generate SQL Script - Step 1 of 2 wizard opens, as shown in Figure 7-4.

    Figure 7-4 Generate SQL Script - Step 1 of 2 Wizard



  3. In the Target Database Version field, select the database version. Ensure that the generated script is compatible with the version of the database that you select here. This is the database where the SQL script will run.
  4. Click Next. The Generate SQL Script - Step 2 of 2 window opens, as shown in Figure 7-5.

    Figure 7-5 Generate SQL Scripts - Step 2 of 2 Wizard



  5. In the Step 2 of the Generate Script Wizard, provide the following information:
    • Script Directory: This is the name of the directory where the generated scripts are stored.

    • Base Directory: Click Browse to navigate to another location and create the directory for the scripts.

    • Directory Path: Displays the path of the script directory.

  6. Click Finish. This triggers the script generation process. Once the scripts are generated successfully, the following message is displayed, as shown in Figure 7-6. Click OK.

    Figure 7-6 Deploy Code Dialog Box


    Description of Figure 7-6 follows
    Description of "Figure 7-6 Deploy Code Dialog Box"

You can check the list of generated scripts in the script directory that you defined in step 5.