This topic describes how to view, clone, delete, and move a function.

Background information

The feature of using Python functions as filters is being optimized. You cannot create, clone, or publish new Python functions.

Create a function

The function module of the earlier versions has been migrated to the business process named Function_EarlyVersion, with original functions and the overall structure retained.

  1. Go to the DataService Studio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region in which the workspace that you want to manage resides. Find the workspace and click DataService Studio in the Actions column.
  2. In the Service Development pane, move the pointer over the Create icon icon and choose Create Function > Create Python Function.
    You can also click the required business process, right-click Function, and then choose Create Function > Create Python Function.
  3. In the Create Python Function dialog box, set the parameters as required.
    Python
    Parameter Description
    Function Name The name of the function, which can be up to 256 characters in length.
    Function Template The template that is used to create the function. Set the value to AviatorScript Standard v1.
    Function Description The description of the function, which can be up to 512 characters in length.
    Destination Folder The folder for storing the function.
  4. Click OK.
  5. Configure the function on its configuration tab.
    1. In the Edit Code section, enter the function code.
    2. In the Environment Configuration section, set the Memory and Function Timeout parameters.
  6. Click the Save icon icon in the top toolbar.

Clone a function

  1. In the Service Development pane, click the business process to which the required function belongs.
  2. Right-click the required function and select Clone.
    Clone menu
  3. In the Clone Function dialog box, set the Function Name and Destination Folder parameters.
    Note The function name must be 4 to 50 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
  4. Click Determine.

Delete a function

  1. In the Service Development pane, click the business process to which the required function belongs.
  2. Right-click the required function and select Delete.
    Delete menu
  3. In the Delete Function message, click Determine.
    Note You can delete only functions that are not referenced by APIs. You must remove the function from the filters of the APIs that reference the function before you can delete the function.

Move a function to another folder

  1. In the Service Development pane, click the business process to which the required function belongs.
  2. Right-click the required function and select Mobile.
    Mobile menu
  3. In the Modify file path dialog box, set the Destination Folder parameter.
  4. Click OK.