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

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 where the target workspace resides. Find the target workspace and click DataService Studio in the Actions column.
  2. On the Service Development tab, move the pointer over Create icon and choose Function > Create Python Function.
    You can also click the target business process, right-click Function, and then choose New > 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 used to create the function. Set the value to Python3 Standard v1.
    Running Environment The runtime environment of the function. Set the value to Python 3.0.
    Function Description The description of the function, which can be up to 512 characters in length.
    Target 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 Save icon in the toolbar.

Clone a function

  1. On the Service Development tab, click the business process to which the target function belongs.
  2. Right-click the target function and select Clone.
    Clone menu
  3. In the Function cloning dialog box, set the Function Name and Target 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 OK.

Delete a function

  1. On the Service Development tab, click the business process to which the target function belongs.
  2. Right-click the target function and select Delete.
    Delete menu
  3. In the message that appears, click OK.
    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. On the Service Development tab, click the business process to which the target function belongs.
  2. Right-click the target function and select Move.
    Move menu
  3. In the Modify file path dialog box, set the Target Folder parameter.
  4. Click OK.