Add Python Paragraph

  1. Click Add Python Paragraph in Model Studio to add a python paragraph in the Notebook and add the following scripting instructions.
    1. To fetch connection objects:

      conn = mmg.getConnection(<workspace name>)

      This creates a cx_oracle based connection object to the datadom of the workspace being passed:

    2. To fetch current Notebook and Model Objective details, use the following predefined parameters:
      • currentNotebookId - fetches the current notebook ID
      • objectiveId - fetches the current objective ID
      To fetch the runtime parameters supported in Model Studio runtime or to access optional parameters passed from scheduler services:
      • To access predefined batch runtime parameters like taskid, batchrunid, and ficmisdate passed during the model execution from scheduler, use the following variables : $BATCHRUNID$, $TASKID$, $FICMISDATE$.

        Example:

        %python
        print('BATCHRUNID value is : ${$BATCHRUNID$}')
        print('TASKID value is : ${$TASKID$}')
        print('FICMISDATE value is : ${$FICMISDATE$}')
        
      • To access any optional parameters passed during the model execution from scheduler, use the below sample script:
        %python 
        print('threshold value is : ${threshold}')
        

    Note:

    Threshold is the optional parameter passed during the model execution.

    Note:

    For more details on the predefined functions available in MMG for python scripting, see Appendix -I.

    Click the icon to run the script.

    Note:

    The execution result from the Pipeline Canvas screen is not displayed in the notebook tab.