Skip to main content

Tasks

Introduction to tasks

A task is a piece of business logic that can be executed manually by the user. A task can be linked to one or more tables and will be displayed in the ribbon, the context menu and possibly in the task bar. In that case, the task is called a table task. Columns of the table can be linked to the parameters of the task. The values of the linked columns of the active record are then passed on to the relevant parameters.

A task has a default and a layout mechanism, just as a table. A shortcut combination can also be defined with which the task can be started using the keyboard.

You can define parameters for a task, and functionality is provided by lookup references.

Tasks overview

This screen contains tasks that take you to the Code overview, Model rights and Menu screens for the selected task. For more information on this generic feature, see Go to a related screen for an object.

Set up a task

Setting up a task consists of the following steps:

  1. Create a task

  2. Set up task parameters

  3. Optional: Create a task lookup

  4. Optional: Add conditional layout

  5. Create a table task

  6. Connect table task parameters

  7. Optional. Add functionality to a task

Create a task

To create a task:

menu Processes > Tasks > tab Tasks > tab Settings > tab General

  1. Enter a Task name.
  2. Select the Task logic type. The following task types are supported:
    • Template: this is the default value, which creates a stored procedure on the database.
    • Windows command: this can be used to call an external program or to open a network or web address. For more information, see Windows command tasks.
    • GUI code: allows for custom C# tasks, such as the TSFtaskMailer, to be linked in. The name of the custom task should be entered in the Object ID field.
    • None: represents a dummy task which can be used in a process flow or to display a form.
  3. If the Task logic type is 'Template', you can select if it should use an Atomic transaction. For more information on atomic transactions, see Subroutine - Atomic transaction. For more information on how to use this in code, see Weave code into atomic tasks.
  4. To use a badge, select the checkbox Show badge. For more information, see Badges.
  5. Optional. change the Generation order no. Only change it to ensure that the tasks with interdependencies are executed in the correct order.
  6. Optional. select a keyboard shortcut which can be used to execute the task. Make sure that the screen does not contain multiple tasks using the same shortcut. Also do not use a shortcut that is already used by the GUI, such as Ctrl + R. For more information, see Shortcuts (used by GUI's). Validations are in place to prevent you from selecting such shortcuts.
  7. Optional. Universal GUI Enter a Form column width factor. This factor determines the relative width of the columns in a form. For more information, see Form column width factor.
  8. If the task should Ask confirmation before executing, select the corresponding checkbox. You can select a confirmation message. Otherwise, a default message will be shown. The task is executed when a message option with a status code of zero or higher is chosen. See also, Message options.
  9. It is possible to execute tasks on multiple rows, with a Popup for each row. This allows a user to provide input for each row. Without visible parameters, the task will be executed automatically. Universal GUI - It is not possible to abort this flow.
  10. Select an option from the drop-down Await result on how to deal with tasks that take a long time to process.
    • Yes - The user has to wait for the result and a progress indicator is shown.
    • Yes (no progress indicator) - The user has to wait for the result (the GUI freezes and hourglass is shown).
    • No - The action is executed in the background and the user can continue working.
    • Optional - The user has to wait (option 1) but has the possibility to continue the action in the background (option 3). Reports executed in the background can be monitored in the Async action dialog. Web GUI - this means that the long-term actions will not cause a request timeout from IIS (default after 90 seconds).
  11. Select the Display parameter to distinguish between multiple instances of a task in the async action dialog.
  12. Optional. if the task should be Offline executable, see Offline available tasks for more information.
  13. Optional. if the task should Repeat after execute, see Repeat a task after execution for more information.

Settings when creating a task

Set up task parameters

After you have created a task, you can add parameters that define the input values for the task. Parameters are arranged in a specific sequence and linked to a domain for the data type and the control.

To set up a task parameter:

menu Processes > Tasks > tab Tasks > tab Default > tab Task parameters > tab Form

  1. Select the Task for which you want to add a parameter.

  2. Enter a Task parameter name.

  3. To create an alternative translation for this parameter:

    • Select the checkbox Translate
    • Enter a Label name.
    • Save the task parameter.
    • Go to the tab Alternative translations to add the translation. See also Alternative translations.
  4. Select a Domain, which determines the data type and control of the field (ID).

  5. Specify if the task parameter should be Mandatory.

  6. Optional. Change the Case type, for example to Upper case.

  7. Optional. In the field Default value type, you can select a Constant value or an Expression:

    • Default constant value - A fixed value that is filled when adding a record. With a change, this value is not filled.
    • Query - The expression used to determine the default value. The query cannot use values from the other task parameters.

    For the following functions, the Software Factory will not generate a function but instead use the given Query as the default value. To use these functions as a default value query, you should specify them without select.

    • newid()
    • getdate()
    • getutcdate()
    • sysdatetime()
    • dbo.tsf_user()
    • dbo.tsf_original_login()

  8. Format the task parameters. The following fields are available:

Settings when setting up a task parameter

Create a task lookup

A lookup allows users to select or view a value from a field in an associated table. For each field, you can configure whether a lookup should be displayed, what reference the lookup should use, and how users select a value. You can set up the default settings for a table in Lookup settings (subjects).

To create a task lookup:

menu Processes > Tasks > tab Default > tab Task look-ups > tab Form

  1. Select a Look-up control to configure how the lookup is displayed for the user. The following options are available:

    • Auto complete - when typing, the first record that matches the input of the user is displayed automatically.
    • Combo (alphabetical) - a value from a combo box can be selected. The list is sorted alphabetically.
    • Combo (sorted) - a value from a combo box can be selected. The list is sorted according to the default sorting of the look-up subject.
    • Suggestions (contains) - When typing, values containing the input are presented. On a mobile device, a keyboard opens.
    • Suggestions (starts with) - When typing, values starting with the input are presented. On a mobile device, a keyboard opens.

    When a new table is created, the default lookup control is set to Suggestions (starts with), since this ensures better performance when returning a large number of rows from a lookup table.

    tip

    For tables with a small dataset, a Combo lookup control may be suitable, since it displays all available values from a lookup table in a drop-down list. For tables with larger datasets, other options like Suggestions (contains) may be more suitable, since this lookup control allows users to search for a value.

  2. Optional. You can create a custom look-up by selecting the checkbox Custom look-up. You can use this setting to override the default lookup control and lookup display column. You can select an alternative Display column, which determines what field is shown to the user when they use the lookup. For example, the default settings for a display column could be to display the customer_name. By using a custom display column, you can set the lookup to display customer_fullname instead.

  3. Optional. Select the checkbox Look-up has popup to display the look-up table in a pop-up window.

  1. Optional. Select the checkbox Refresh on dropdown to refresh the lookup data before the combo box expands.
  2. Optional. Select a Look-up table variant to display a variant of the lookup table.

After you have created the lookup, you must create a task lookup column to display the relevant information from the table you have referenced.

tip

You can use the task Create reference to create a reference and set up the lookup columns immediately. The lookup control will automatically be set to Combo (alphabetical) and that the lookup has a popup.

Lookup settings for a task Lookup settings for tasks

Create a task lookup column

A lookup column defines which data from a referenced table is retrieved and displayed in the lookup. Before you can create a lookup column, you must create a task lookup.

To create a task lookup column:

menu Processes > Tasks > tab Default > tab Task look-ups > tab Look-up columns > tab Form

  1. Select a Task parameter.
  2. If a Column with the same name as the task parameter exists, it will automatically be filled. Otherwise, you must select it manually.
  3. Optional. Add a Sequence no to change the order of the columns.

Lookup column settings for a task Lookup column settings for a task

Add conditional layout

menu Processes > Tasks > tab Conditional layout

This is an optional step. Just as with columns, you can give task parameters a background color or a different font. You can use this to draw the user's attention to a specific task parameter. Since a task does not have a grid, this will only be applied to form parameters.

More information on conditional layouts can be found here.

Settings when setting up a task conditional layout

Add functionality to a task

This is an optional step that depends on the task logic type.

When generating, a program object is created for template-typed tasks. The associated default and layout program objects are also created. The application logic can be modelled and described in the Functionality screen.

Weave code into atomic tasks

You can weave your own code into the catch part of atomic Tasks. The catch part has been separated into two templates, allowing templates to be weaved in-between. You could use this, for example, to weave code for logging. For more information, see Atomic transactions.

menu Business logic > Functionality > tab Assigning > tab Available templates > tab Assigned templates

Assigned templates Example: add your own code in the catch part

Display progress from a stored procedure

When performing long-running tasks or tasks in combination with multi-selection, a progress dialog is displayed. In addition, the progress percentage can also be displayed from (SQL Server) stored procedures while a procedure is being executed.

Progress Percentage of executing a task

To display the percentage, the procedure 'tsf_send_progress' should be called from the SQL code:

tsf_send_progress *[message id], [parameterstring], [percentage]*;
  1. Fill the Message ID: optional parameter, use it to change the text above the progress bar (default: Run task...) by the translation of a message_id.
  2. Fill the Parameter string: optional parameter for filling parameters in the translation if you are using a specific message_id. It is also possible to use translations of model objects, such as columns or tables.
  3. The progress in percentages. By setting the percentage to -1, the progress bar remains in the marquee position.

An example when executing a stored procedure from SQL Server is:

exec tsf_send_progress 'copy_customer', '<text>Thinkwise</text>', 82;

Table tasks

Set up a table taskA table task is a task that is linked to one or more tables. In these tables, the task is displayed in the ribbon, the context menu, and possibly the task bar.

Create a table task

To link a table to a task:

menu Processes > Tasks > tab Default/Variants > tab Table tasks > tab Table task > tab Form

  1. Select the Table and Task.

  2. Optional. Select a Task variant. See Create a task variant.

  3. If necessary, change the Sequence no to determine the order of the tasks in the task bar.

  4. Optional. Select the Task group from the drop-down list. See Create a task group.

  5. To make the task available, select the checkbox Available.

  6. By default, a task is available when a screen contains no records. To disable the task in that case, clear the checkbox Enable for empty subject.

    note

    The default for field Enable for empty subject is set in the menu Models > Model overview > tab Branches > tab Model settings.

  7. To enable immediate task execution by double-clicking on a row, select the checkbox Double click on record. For more information, see Configure a double-click task.

  8. To control the performance, configure the Refresh after execute behavior:

    • None - the user interface will not refresh any data.
    • Row - the user interface will only refresh the current row.
    • Subject - the user interface will refresh the current subject, including lookups and details.
    • Document - the user interface will refresh the main subject, including all lookups and details.
  9. Optional. To show a table task in a Task bar or a (Custom) action bar, select the same Screen area as the bar. For more information, see Screen areas.

  10. Optional. Select the Custom display type:

    • Universal GUI - If there is enough space, the task is presented according to the selected type. If not, the task will be shown in the overflow menu. If left empty, the custom display type of the Custom action bar is used, or else the custom display type of the Action bar.

      For example, Icon + text (> text > icon) means that the report is displayed as an icon with text. On a smaller screen with less space, it is displayed as text (the first fallback: > text). With even less space, it is displayed only as an icon (the second fallback: > icon). The overflow menu is always the last fallback type, except for the display type Hidden.

    • Windows GUI - The following options are supported:

      • Hidden - The task is not shown but can be started with a keyboard shortcut, a double-click task, or a process flow.
      • Overflow - The task is not shown in the task bar but is shown in the ribbon menu and context menu.
      • In all other cases, the task is shown in the task bar, the ribbon menu, and the context menu. On a smaller screen with less space, it is moved to the overflow menu.

Table tasks Settings for a table task

Create a task group

Tasks within a table can be grouped together to display them logically.

To create a task group:

menu Processes > Tasks > tab Table tasks > tab Task groups > tab Form

  1. Enter a name for the Task group.
  2. Optional. select the checkbox Submenu to display the task group through a submenu instead of using separators.
  3. Select the Sequence no. With this setting you can influence the order in which the task group appears.

The task group is now available for selection if you create or edit a task.

As soon as a task is assigned to a group, the task will appear in the grouped grid. From there, you can also drag/drop other tasks into this group.

Connect table task parameters

After linking a task to a table, connect the table columns to task parameters:

menu Processes > Tasks > tab Table tasks > tab Table task parameters

  1. Select a Task parameter. The active record's field value is passed on to the parameter as a default value.
  2. If a Column with the same name as the task parameter exists, it will automatically be filled. Otherwise, you must select it manually.

Table tasks Settings when connecting table task parameters

You can link a task directly to a table as explained before (see Create a table task).

This is also possible at subject level, in that case you link en existing task to an existing table:

menu User interface > Subjects > tab Overview

See Link a task to a table in the Subjects guide.

Configure a double-click task

It is possible to enable immediate task execution by double-clicking on an item. This setting works for grid, card list, grouped tree, and resource scheduler items.

  • For the Web GUI, a double-click task is always visible in the toolbar.
  • The Universal GUI and the Windows GUI support different presentations for double-click tasks with the Custom display type option.

In addition, you can bind the task to a specific column. This can significantly improve the user experience because it allows each column in a grid to start a different process or handle specific data.

To configure a double-click task:

menu User interface > Subjects > tab Links > tab Tasks > tab Task > tab Form

  1. Select the task that you want to link to the selected table.
  2. Select the Double click on record checkbox.
  3. In the field Double click column, select a column from the table. You can override this column choice in a table variant or leave it empty. This transforms the cell-based double-click task into a row-based double-click task in the specific table variant and vice versa.

Configure a double-click task

Copy a task

To make a copy of a task:

menu Processes > Tasks > tab Settings

  1. Execute the Copy task copy task.
  2. Enter a name for the copy in the field To task.
  3. Select what you want to include in the copy:
    • Table tasks - Include the links to one or more tables. See Table tasks.
    • Functionality assignments - Include the functionality assignments. If you deselect this option, the copied task will not be assigned to any control procedure. Use this to create a bare object (the copied task). Then, create a new control procedure, and assign the copied task to it.

copy task Copy a task

Add a task to a menu

If a task is linked to a table, it appears in the ribbon and the context menu of this table. You can also add a task to one or more menus (tree view, list bar, and tiles). In this way, users can start the task without having to open another screen.

To add a task to a menu for the first time:

menu User interface > Menus > tab Menus

  1. For more information about the configuration of a menu and how to add a task to it, see the Menus guide.

To edit a menu:

menu Processes > Tasks > tab Menu

This tab is read-only. Here, you can see to which menus a task is connected.

  1. Execute the task Go to menu Go to menu to open the corresponding tree view, list bar, or tile menu item where you can edit it.

Create a task variant

With a task variant, you can create an alternative user experience for the same task. Not all default settings can be changed in a task variant, but it can, for example, have a different icon and translation, default values and conditional layouts than the default. For more information on variants, see Variants.

note

A task variant is not a copy of the original task. A variant is still linked to the original task, while a copy is not. To create a copy of a task, see Copy a task.

To create a task variant:

menu Processes > Task

  1. Select the task Create a task variant.
  2. In the pop-up, select the Task for which you want to create a variant.
  3. Enter a Task variant name.
  4. Optional. To generate a different translation for the variant, select the checkbox Translate.
  5. Select Execute.
  6. Go to the tab Variant to set up the task variant.
tip

In the tab Changes compared to default, you can view a list of the differences between a task variant and its default task. For more information, see Compare a variant to its default.

Alternative translation for a task variant parameter

It is possible to create an alternative translation for a task variant parameter in a form or tooltip. This translation is used in the user interface instead of the default translation. See also Alternative translations.

To create an alternative translation:

menu Processes > Tasks > tab Variants > tab Task parameters

  1. Select the checkbox Alternative translations.
  2. Enter an alternative translation Label.
  3. Save the settings.
  4. Go to the tab Alternative translations.
  5. Add an alternative translation.

Set up special tasks

Drag-drop

Using drag-drop, you can allow users to drag records from a grid or tree to another or the same subject. When the user drops an item on that table or row, the drag-drop task is started.

To configure drag-drop:

  1. Set up a drag-drop task. Before you can select a task as a drag-drop task, you must first create that task through the regular process. See also, Set up a task.
  2. Set up the Drag-drop links. What makes a task a drag-drop task is not determined by any setting within the task itself, but rather by its configuration as a drag-drop task on that screen.

Windows command task

Tasks can be used to call an external program or to open a network or web address. The location of the external program, the network or web address have to be entered in the Object name field. Any parameters that are added to the task will be passed on to the call of the external program. However, this only works with external programs and not with network or web addresses.

To start Paint for example, enter the program name mspaint.exe in the object name and add a filename parameter to open that file.

Or create your own batch file to print a PDF document:

@CALL START /MIN AcroRd32.exe /N /T %1

With the use of parameters, it is also possible to create dynamic external program tasks. This can be used in situations in which the external program, network or web address to be opened is not always the same but changes depending on the situation. In these cases, a parameter has to be added to the task with the location of the external program, network or web address. The task parameter ID of this parameter has to subsequently be specified between square brackets in the Object name field of the task (e.g., [URL]). For dynamic external program tasks, all other parameters are ignored.

To open a dynamic URL without knowing the default browser, you can trick the task by using 'http:' as Object name and set the first parameter to the URL to be opened. The same goes for other URI schemes like 'mailto:'.

Universal GUI Example: Use a Windows command task to open a URI

menu Processes > Tasks > tab Tasks > tab Settings > tab General

  1. In the Task logic type field, specify 'Windows command'.

  2. In the Object name field, specify the URI to open.

    Windows command task Windows command task opening a URI

When executing this task, the corresponding URI is opened in the browser. You can also use dynamic URIs via task parameters. In that case, the Object name field must contain the task parameter id between square brackets: [task_parmtr_id].

Please be aware of the following limitations:

  • This implementation only supports opening URIs and not executing Windows commands.
  • Windows command tasks cannot be used in process flows.

Offline available task

Universal GUI

If the connection is lost, a user is requested to close their work and continue offline. For more information, see the Universal user interface guide: Menu tasks in offline mode.

Restrictions when working in offline mode:

  • The tasks cannot contain lookups/domain/file controls.
  • The tasks will check for mandatory fields but make no other validations.
  • The tasks will not execute application logic for parameter input. This will be done later when the user is online again.
  • The task control procedures should accept all input without throwing errors since a user cannot fix these when synchronizing afterward.

To make a task available for offline execution:

menu Processes > Tasks > tab Tasks > tab Settings > tab General

  1. Select the checkbox Offline executable.
tip

You can use two extended properties for additional functionality when working offline:

  • RepeatOfflineTasks repeats a task after execution when offline.
  • HideOfflineTasksReadonlyParameters hides all read-only task parameters when offline.

Task which repeats after execution

menu Processes > Tasks > tab Default/Variants > tab Settings > tab General > group User interface

It is possible to specify that, after executing the task, the task pop-up should automatically reopen. You can use this setting, for example, for bar code scanners and task execution after scanning a product. By repeating the task, a user can continue scanning products without manually reopening the task pop-up.

To repeat a task after execution:

  1. Select the checkbox Repeat after execute.

Was this article helpful?