Define Python Code and Specify Parameters for a General Script

Note: A user who is not a member of the MI Cognitive User Security Group can view a general script, but cannot create, modify, save, or test a general script.

Steps

  1. Access the script that you want to define.

  2. Select the Script tab, and then enter your Python code.

  3. Define each parameter in the script. When you define a parameter, you are specifying whether each parameter in the general script is an input or output parameter, and the type of data that it requires. To do so:

    1. At the bottom of the page, select Parameters.

      The Parameters pane appears.

    2. Select .

      A new row is added to the grid.

    3. In the ID cell, enter the parameter ID exactly as it appears in the script.
    4. In the Name cell, enter a name for the parameter as you want it to appear to the script and to the cognition user (e.g., on the Properties window for the Script node).
    5. In the Type list, select the data type of the parameter.

    6. In the Direction list, specify whether the parameter represents an input or an output.

      Note: Only one output of each type (i.e., value and score) should be specified.

    7. For each parameter in the script, repeat steps b through f.
    8. Select .

      The script parameters are saved.

      Tip: If you want to delete a parameter, in the row for the parameter, select Delete.

What's Next?

Copyright © 2018 General Electric Company. All rights reserved.