Manage R and Python Scripts
Create an R or Python Script
Procedure
- In the Applications menu, navigate to the TOOLS section, and then select R Scripts.The R Scripts page appears.
- Select Create New.The New R Script page appears, which contains the script editor.
- If you want to create a Python script, select the Python script option.
- In the editor, enter your R or Python code.Note: When you use scripts with policies, the policy execution engine sends date inputs to the relevant services in UTC. If your script performs any calculations based on dates, the date output must also be in UTC and use the standard date format yyyy-MM-dd hh:mm:ss.fff.
- Define each parameter in the script using the Parameters pane.
- Select
.
The Save As window appears. - In the Catalog pane, navigate to the location at which you want to save the script.
- Enter values in the Name, Caption, and Description boxes.
- Select Save. The script has been saved.
Define Parameters in R and Python Scripts
About This Task
Procedure
- Access the R script for which you want to define parameters.
- At the bottom of the page, select Parameters.The Parameters pane appears.
- Select
.
A new row is added to the grid. - In the ID cell, enter the parameter ID exactly as it appears in the script.
- In the Name cell, enter a name for the parameter as you want it to appear to the Policy Designer user.
- In the Type list, select the data type of the parameter.
- In the Direction list, specify whether the parameter represents an input or an output to the script.
- If the parameter is an input and is required, select the Required check box.
- For each parameter in the script, repeat steps 3 through 8.
- Select
.
The script parameters are defined.
Delete Parameters in R and Python Scripts
Procedure
- Access the R script containing the parameter that you want to delete.
- At the bottom of the page, select the Parameters tab.The Parameters pane appears.
- On the left side of the Parameters pane, select the check boxes in the rows for the parameters you want to delete.
- In the upper-left corner of the pane, select
.
The parameter is removed from the Parameters pane. - Select
.
The script parameters are deleted.
Delete a R or Python Script
Procedure
- Access the Catalog page for the folder that contains the script that you want to delete.
- Select the check box that corresponds to the script that you want to delete.
- In the upper-right corner of the page, select
.
A confirmation message appears, asking if you really want to delete the script. - Select OK.The script is deleted.