Skip to main content

K-A End User Help

User Tasks

User tasks is a much more powerful means of adding functionalities to K-A. Unlike functions, user tasks require software development knowledge but can use any available information from K-A and can create not only output channels but take a variety of actions like compiling custom plots, creating files, loading data to the files etc.

The principle of working with the User Tasks like with Functions is to first define a user task in the Automation mode and then create as many user tasks instances as necessary for any well or group of wells in PDG mode.

User Tasks fall under the two categories:

  • Built-in user tasks

  • Custom user tasks

  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 setup may be customized for the user task.

  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 and C# languages.

dlg_usertask_script.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 or C#.

    • 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.

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

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

    • Scripting language: Python or C#.

    • 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.

Built-in user tasks cannot be deleted or edited. Their definitions may only be viewed. They may however be duplicated, and the duplicate edited.

  1. Switch to Automation mode.

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

  3. Select any user defined user task in the list.

  4. Click on Delete, inl_delete_file.png, at the top.

  1. Switch to Automation mode.

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

  3. Select any user task in the list.

  4. Click on Duplicate, inl_duplicate_plot_template_icon.png, at the top.

  1. Switch to Automation mode.

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

  3. Select any user defined user task in the list.

  4. Click on Edit, inl_edit_plot_template_icon.png, at the top.

  1. Switch to Automation mode.

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

  3. Select any built-in user task in the list.

  4. Click on View, inl_view_icon.png, at the top.

After a user task is created in the Automation mode, any number of User Task's instances can be created for any well or group of wells.

  1. Switch to PDG mode.

  2. Select the field.

  3. Select the well in the field hierarchy.

  4. Click on User Task, inl_usrtsk_icon.png, in the toolbar at the top.

    dlg_create_usrtask_instance.png
  5. Select the user task from the User task definition drop down list. The list will display all the available user tasks.

    Tip

    Once selected, hover the cursor over the Info icon, inl_info_icon.png, to read the user task description.

    see_usrtask_info.png

    The dialog will be refreshed with the different input and output parameters and other settings related to the selected user task.

  6. Rename the user task instance if needed.

  7. If necessary, edit the default input parameters. To redefine the data channels, use the drop down list or browse through the channels in the well.

    Important

    Inputs section contains a list of channels in the well having the data type that was defined when a user task was created in Automation mode. If no label was set the reference channel is selected by default. If a label(s) was added, the drop down list contains only the channels with the label(s) attached.. If there are no data of the necessary type in the well you will see No match found and the instance cannot be created (Create button is not active).

    Note

    If an input parameter is optional it can either be empty or have some default value. If it is not empty or you have set some value/selected some item from a list but finally decided not to use this optional parameter in the calculations, clear the input by clicking on inl_clear_selection.png.

    Tip

    Data types and other input attributes can be edited from the user task instance dialog. For this click on inl_labels.png to activate the dropdown list of attributes and edit it.

    If the list of available channels is big it is possible to reduce the choice of the channels by introducing label(s) aprior.

    User_task_data_types.png
  8. Optional. In the Output section, add/remove or edit any labels which may have been assigned to the output channels.

  9. Optional. For user tasks with output channels, the output can be previewed using Show preview.

  10. Optional. For job settings, the timeout can be modified.

    Timeout_user_task.png
  11. Click on Create.

    Note

    User task instances are listed under a dedicated User tasks folder under the well in the field hierarchy.

  1. Switch to PDG mode.

  2. Select the field.

  3. Switch view to Well flat view.

  4. Select the wells for which the user task instance is to be created.

  5. Click on User Task, inl_usrtsk_icon.png, in the toolbar at the top.

  6. The remaining procedure is similar to the one explained above, with the following exception:

    Important

    In bulk creation it is not possible to set the input data channels for each well individually; the reference channels of the corresponding data type will be used automatically.

Some improvements have been introduced to existing user tasks, accompanied by the development of new ones. The details are outlined in the following sections.

Corrected production user task improvement

Enhancements have been implemented in the corrected production user task, enabling high-frequency inputs for rates, introducing new output options, additional optional inputs, and the capability to restart the operation from the conclusion of the last non-edited shut-in. Notably, the ‘Correct Spikes’ option has been introduced to eliminate sharp anomalies from the data, ensuring a smoother representation. Additionally, the ‘IQR Multiplier’ option provides control over the height of the removed spikes; a higher value will selectively remove only exceptionally high spikes.

Corrected_production_user_task.png

sRTA user task improvement

To improve the readability and performance of the sRTA user task, refactoring has been undertaken. This includes improvements to the overall format, the addition of new outputs such as time series and custom plots, and optimizations to the user task interface.

sRTA.png
SRTA_2.png

Dual filter: new built in user task

The user task functions as a fine filter, particularly effective during shut-ins, and facilitates decimation outsides of shut ins. Its inputs involve consideration of both pressure and shut in.

Dual_filter.png

Consistency check user task improvement

Enhancements have been introduced to the consistency check user task, removing the need to provide an iPTA Document. Users can now execute it without requiring an iPTA execution. Furthermore, the option to input the shut-in reference has been incorporated, providing users with the flexibility to set the reference as needed. A consistency cut-off parameter has been also been introduced, which helps to exclude shut-ins with a consistency value below this specified threshold.

consistency_check_user_task.png

Simplify: new built in user task

This user task, extracted from the the correcte production user task, is designed solely to streamline the rate. Its inputs encompass the rate data and its various types, simplification methods, and Delta Y. It gives a simplified rate as output.

Simplfy_user_task.png