Skip to main content

K-A End User Help

Defining a User Task

  1. Switch to Automation mode.

  2. Select User tasks in the hierarchy on the left.

  3. Click on Create, inl_usrtsk_icon.png, in the toolbar at the top.

  4. Under the General Tab:

    1. Give the new user task a Name. Name must be unique and can be a combination of letters, symbols and numbers.

    2. Set a Version. Version can consist of letters, numbers and symbols; it can be useful in future development or testing a user task.

    3. Define the Event Key. This can consist of letters, numbers and symbols; it can be used to create events publications that users can

      subscribe to and/or use in the future.

    4. Check Handles restart input if you want to allow this user task the ability to restart the job after it has been defined.

    5. In Allowed context dropdown list, select where you can create this user task: well, well group, field or all of them.

      Note

      User task definitions are now filtered based on their allowed context. For example, at the well group level, only tasks defined with the well group allowed context will be visible, and the same applies to each level.

    6. Enter a User task description. This should be comprehensive enough for an end-user to understand what the task is doing.

      Tip

      This information can be viewed during user task instance creation:

      see_usrtask_info.png
    7. Optional. Type in Input parameter description and Output parameter description. Like User task description, they can be viewed during task instance creation.

    8. Optional. Upload a help file (doc, pdf, or text) by clicking on Attach help file icon. This file should provide a description of the user task together with the instructions on how to use it.

      user_tasks.png
  5. Click on Next to move to the Parameters tab.

    The left part of the dialog lists Inputs while the right one lists Outputs.

  6. Under the Parameters tab:

    1. To add a new input or output parameter, click on Add under the relevant section.

    2. Specify the parameter name, its attributes, Type and Data type.

    3. Specify whether the parameter is By Step and/or High frequency.

    4. Optional. Add a label to the function if it is going to be used in the future. Label can be selected from the dropdown list or created by typing a name and hitting Enter.

      See User Task Parameters for more details.

    Tip

    As the parameters list grows, it may affect the readability of the list. In such cases, it is possible to collapse the parameters description list to make it concise by clicking on inl_collapse_all.png. To expand all the parameters back click on inl_expand_all.png. Individual parameters can be collapsed/expanded using the chevron next to the parameter name.

  7. Click on Next to move to the Script tab.

    This is where the main script of the user task will be written.

    See User Task Script for more details.

  8. Optional. Click on Next to access the optional Settings tab, where Data Synchronization and Job settings can be customized for the user task.

    User_task_settings.png
  9. Click on Create.

User task script is a code to implement a user's workflow inside KAPPA-Automate. This is achieved by inserting the code block into the Scripts tab in the Create a New User Task dialog box.

Currently, K-A supports user task development in Python language.

User_task_definition.png

Tip

To facilitate the task development in Python, an SDK provides a simplified access to the platform APIs. The Python SDK can be used to develop and run a code locally, and then migrate this code into a User task in K-A so that it can be executed by the platform automatically on selected triggers. The detailed information on the code development can be found in the KAPPA Automate Extension Guide.

When programming more elaborate tasks, it may be necessary to load external packages/libraries. These could be standard Python libraries e.g., Numpy, Scipy etc., or user modules. The packages to be used in the main script of a user task should be uploaded to the list of packages before creating the task. (see Uploading Packages for User Task Scripting below).

If certain packages to be used in the main script are not already available on the backend, they should be uploaded to the list of packages before/while creating the task.

Uploading a package before creating a user task
  1. Switch to Automation mode.

  2. Select User tasks in the hierarchy on the left.

  3. Switch to the Packages tab.

  4. Click on Create.

  5. Input the following information about the package:

    • Name: any combination of letters, numbers and symbols.

    • Scripting language: Python.

    • Package description: text information that helps managing the packages.

  6. Upload the package. This can be done in one of two ways:

    • Click on Select zip package. Or,

    • Drag and drop the zip file in the Drag and drop zip package area.

  7. Click on Create.

Uploading a package while creating a user task
  1. Under the Script tab, click on + next to the Package dropdown menu.

    Creating_a_package.png
  2. Input the following information about the package:

    • Name: any combination of letters, numbers and symbols.

    • Scripting language: Python.

    • Package description: text information that helps managing the packages.

  3. Upload the package. This can be done in one of two ways:

    • Click on Select zip package. Or,

    • Drag and drop the zip file in the Drag and drop zip package area.

  4. Click on Create.