The Workflow supports a set of activities of various types to configure a process that fits your needs.

See the Workflow Editor article to familiarize yourself with the functionality.

Available activities:

To define variables in your activities via the agent interface if necessary, complete the steps below:

  1. Navigate to Workflow → Activities.
  2. Open the activity record you need to edit or click New to create a new activity.
  3. Fill in the fields.
  4. Click Save or Save and Exit to apply the changes.

See the Creating a new activity article to learn more.

Basic activities


Begin activity

This activity, along with the End activity, is initial and appears in a newly created workflow. It is a logical start of every workflow.

End activity

This activity, along with the Begin activity, is initial and appears in a newly created workflow. It is a logical conclusion of every workflow. 


Utilities


The activities included in this category execute scripts, change and update records.

Run Script activity


The Run Script activity executes the defined script.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
Run ScriptNSpecify the script to execute.
DescriptionNType a brief description of the activity.


This activity type causes the update of the current target record after execution. The activity logic is defined by the Immediately value in the When to Run field within the Workflow Activity Type (wf_activity_type) table.

Also, the Immediately option and the related activity behavior allows to avoid the update of records within Run Script scripts, as follows:

Run Script
current.update();

It will be done automatically.

Join activity


The Join activity combines several activity exit transitions, so that they turn into one transition. This activity is useful for synchronizing several activities, so that the next activity does not start until the previous ones are finished.

In the example below, the Join activity waits for the results of processing of the If, Subflow, and Wait activities. If all three transitions from these activities lead to the Join activity, the path of the Complete exit is taken (to the activity named Insert). If one of the activities bypasses the Join activity (in this case, it is the No exit of the If activity), then the Incomplete exit is taken.

Never join multiple exits from an activity to a single Join activity, otherwise, the Join activity works incorrectly and never selects the Complete transition.

In the example below, both exits from the If activity lead to the Join activity. Even though the condition of the If activity is met, the Join activity selects the Incomplete exit as the No exit from the If activity is inactive.

How to use the Join activity

  1. In the left side menu, open the Utilities tab and drag and drop the Join activity.
  2. Connect the exits of the activities you need to join with the Join activity.
  3. Then, create transitions from the Join activity exits (Complete and Incomplete) to the next activities.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description for the activity.

Activity exits

ResultDescription
Complete

This exit is taken when all joined activities have finished running and proceeded to this activity.

Incomplete

This exit is taken when all joined activities have finished running, but at least one of them has not proceeded to this activity, that is, another path was taken bypassing the Join activity.

Example:

In this case, the If activity bypassed the Join activity; therefore, the Incomplete exit was taken.

Set Values activity


The Set Values activity sets specific values to the current record. These values determine the activity behavior when the workflow freezes or ends.

This activity type causes the update of the current target record after execution. The activity logic is defined by the Immediately value in the When to Run field within the Workflow Activity Type (wf_activity_type) table.


Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity.
TableY

A table to be affected by this activity. This field is populated automatically.

Set ValuesN

Select the field whose value you want to change when the workflow freezes or ends, and define the new value.

Click the leftmost field to open the drop-down list of available fields. Click the rightmost field to open the drop-down list or enter the value (depending on the type of the selected field).

Record Generator activity


The Record Generator activity creates records in any table extending from the Task table.

If both the Wait For Condition Complete and Advanced checkboxes are selected, then they both must be evaluated for this activity to proceed with the transition.

Make sure that all mandatory fields are populated when using this activity; otherwise, the workflow will break its execution.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity.
Task TypeY

Select the task type. You can make a selection from the corresponding task table. Click the magnifier icon  to see the list, or start typing the table name in the field to select from autosuggest.

Task Values from

N

The source of values for a task to be created. Available options:

  • Values – values that you specify in the appropriate choice list.
  • Template – an existing template related to the selected task table.
Set ValuesN

Specify an existing template related to the selected task table.

This field appears when the Task Values from field value is equal to Values.

Task TemplateY

Specify an existing template related to the selected task table.

This field appears when the Task Values from field value is equal to Template.

Wait for Condition CompleteN

Select this checkbox to display Completion Conditions. When selected, the conditions are mandatory for completing the task.

Completion ConditionsY

Specify conditions for the created task. The process will not proceed to the next activity until the task meets all conditions.

The field is displayed when the Wait for Condition Complete checkbox is selected.

AdvancedNSelect this checkbox to specify a script to execute. When you select this checkbox, the Script text field appears.
ScriptN

Set values for the task in this script. Use the variable 'new_task' when setting additional values. This field is displayed when the Advanced checkbox is selected.

A script runs after the task values are set (defined in the Task Template or Set Values fields).

For example:

Script
new_task.parent_id = current.sys_id;
new_task.caller = current.getValue('caller');


Create Event activity


The Create Event activity establishes an event from the Event Register (sys_event_register) table in a queue. Later, this event can execute specific scripts or send notifications. When the Create Event action runs, a new event record is created in the Event (sys_event) table.

See the Events article to learn more.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
EventY

Choose the event instance on the basis of which the activity will create events. All the event instances (or event registers) are listed in the Event Registers (sys_event_register) table. Click the magnifier icon  to see the list, or start typing the event name in the field to select from autosuggest.

Param 1 ... Param 5N

Specify the event parameter. If this parameter is a string value, it must be enclosed in quotes.

The defined parameters may be used in records related to the system event:

  • records of the Notification Rule (sys_notification_rule) table
  • records related to the Notification Rule (sys_notification_rule) table: Notifications Script (sys_notification_script) and Notification Template (sys_notification_template)
  • records of the Event Script Actions (sys_event_script_action) table

See the Events article to learn more.

DescriptionNType a brief description of the activity.


Conditions


The activities included in this category set conditions to continue the processing and define further transition of the workflow. The transition taken depends on the conditions set and the activity outcome.

Wait Condition activity


The Wait Condition activity pauses the workflow until the defined conditions are met. The activity checks if the record meets the conditions after every record update.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity.
TableNA table to be affected by this activity. This field is populated automatically.
ConditionYDefine conditions mandatory for proceeding with the Yes transition.
AdvancedNSelect this checkbox to specify a script to execute. When you select this checkbox, the Script field appears.
ScriptN

This field appears when the Advanced checkbox is selected. If specified, the workflow is paused at this activity until this script returns true. The result of the script execution will be added with the AND operator to the results of the Condition specified.

Example
const isUserManager =
  ss.hasRole('process_manager'); // true or false
return isUserManager;

If both Condition and Script are specified, then both of them must execute successfully to transition to the next activity. The workflow will stay paused until the Condition is met and the Script returns true.

If activity


This activity checks a condition to determine if a Yes or No transition should be taken.

If both the Condition and Advanced checkboxes are selected, then they both must be evaluated for this activity to choose the Yes transition; otherwise, the No transition is chosen.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity.
TableYA table to be affected by this activity. This field is populated automatically.
ConditionY

A condition to meet in order to proceed with the Yes transition

An empty condition always returns true.

AdvancedNSelect this checkbox to specify a script to execute. When selected, the Script field appears.
ScriptN

This field is displayed when the Advanced checkbox is selected. If the script is executed, the result of the script will be added with the AND operator to the results of the Condition specified. To proceed with the Yes transition, the script should return the true value.

Example
const uc = new SimpleUserCriteria();
const isUserLocal =
  uc.userAcceptanceByCriteria(ss.getUserID(), '165470191717512124'); // true or false
return isUserLocal; 


Switch activity


The Switch activity manages transitions by checking the field values against the defined case values (one or more). This activity works like the switch statement.

The activity checks against conditions specified in the Column field or in manually defined exits and, based on the outcome, selects the next transition.

Activity fields

FieldMandatoryDescription
TableNA table to be affected by this activity. This field is populated automatically.
NameNActivity name. A good practice is to make the name descriptive for clarity.

Type 

Y

Select the source of exit options for this activity. The workflow will perform check values against these conditions. Available options:

  • Field – the exits are equal to the options of the field specified in the Column field.
  • Customcreate the set of exits with the conditions you need.
ColumnY

Specify a column containing options for the condition. These options will become exits of the activity. Click the magnifier icon  to see the list, or start typing the column name in the field to select from autosuggest.

This field appears when Field option is selected in the Type field.

In the example below, the Switch activity takes options from the Type field.


You can change conditions of the exits or add new conditions by editing them.

To create additional exits, perform the following steps:

  1. Right-click the Switch activity and select Add exit.
  2. Double-click the exit to open the exit form fields.
  3. Fill in the fields.
  4. Click Save.
  5. Repeat to add more exits if needed.

FieldMandatoryDescription
NameN

The option name. If the Type field is equal to Field, the name is taken from the Column. If the Type field is equal to Custom, specify the name you like.

TableNA table to be affected by this activity. This field is populated automatically.
ActivityYThe activity to which this exit is related. This field is populated automatically.
DescriptionNType a brief description of the activity exit.
ConditionYDefine conditions mandatory for proceeding with this specified transition.
AdvancedN

Select this checkbox to specify a script to execute. When selected, the Script field appears.

ScriptY

This field appears when the Advanced checkbox is selected. If specified, the workflow is paused at this activity until this script returns true.

If both Condition and Script are specified, then both of them must execute successfully to transition to the next activity. The workflow will stay paused until the Condition is met and the Script returns true.


In case of the Switch activity, every exit can be configured with individual scripts. So the Advanced checkbox appears only when the activity has more than one exit. The checkbox appears only on exit forms.

Approvals


The User Approval activity configures the approval processing: it creates approvals, sets approval rules and conditions.

User-approval activity


The activity evaluates the result depending on the following factors:

  • the decision made by the approvers
  • conditions specified in the Approved When or Approval Conditions and Reject Conditions fields
  • (optional) conditions specified in scripts.

The activity can be completed with one of two results: Approved or Rejected.


Activity fields

NameMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity. It is displayed on the activity block on the canvas if provided.
TableYA table to be affected by this activity. This field is populated automatically.
Run ConditionsN

Specify conditions to be met for generating approvals. If these conditions are not met, the workflow skips the activity. In this case, the Approved exit is taken.

Approval TypeN

Specify the approval type to define the conditions of the activity exits. Available options:

  • Automatically – select the conditions of the activity completing in the Approved When field from a predefined set of conditions.
  • Manual – configure your conditions of the activity completing you need in the Approval Conditions and Reject Conditions fields.
Non-Mandatory ParticipantsN

Select this checkbox to add the participants whose approvals are not mandatory to vote. When this checkbox is selected, the Non-Mandatory Participants tab appears.

Mandatory participants tab
EmployeesN

Select responsible users. They will receive the approvals and make their decisions. Click the magnifier icon  to select from the list or start typing the user name to select from autosuggest.

GroupsN

Select responsible groups. Users included in this group will receive the approvals and make their decisions. Click the magnifier icon  to select from the list or start typing the group name to select from autosuggest.

RolesN

Select roles whose owners will receive the approvals and make their decisions. Click the magnifier icon  to select from the list or start typing the role name to select from autosuggest.

AdvancedNSelect this checkbox to specify a script to execute.

Script 

N

If the Advanced checkbox is selected, this script is called to determine if any additional approvals should be created.

The script is intended to set the answer variable to a comma-separated list of user IDs to add as approvers.

This field appears when the Advanced checkbox is selected.

The code example below implements logic as described below:

  1. Checks groups of the current caller.
  2. Checks the value of the Responsible attribute of these groups.
  3. If the group responsible was found, then his user ID is added to the answer array.
Script example
const caller = current.getValue('caller');
const callerGroup = new SimpleRecord('sys_user_group');
callerGroup.addQuery('user_id', сaller);
callerGroup.selectAttributes('group_id');
callerGroup.query();
while (callerGroup.next()) {
  if (callerGroups.group_id.getValue('responsible')) {
    answer = callerGroups.group_id.getValue('responsible');
  }
}

You can pass values to the answer variable either as a string or as an array, for example:

answer = ['100000000000000001', '160017550418345219', '159974538715046822']

answer='100000000000000001,160017550418345219,159974538715046822'

Approved WhenN

In this field, you can define the approval logic. Available choice options:

  • Anyone to approve – the Approved exit will be taken if at least one responsible user approves the ticket.
  • Everyone to approve – the Approved exit will be taken only if all responsible users approve the tickets; otherwise, the workflow will take the Rejected exit.
  • First response from anyone – the exit to be taken depends on the first decision received: the first user who happens to make the decision defines the outcome.
  • Most answers – the activity outcome depends on the number of approvals and rejections: if there are more approvals, then the Approved exit is taken and vice versa.
  • Conditions based on script – the activity outcome depends on the Script that calculates the result every time it receives approval or rejection.

This field appears when the Approval Type is equal to Automatically.

Approval ConditionsY

Specify the conditions to be met for the Approved exit. If there is more than one condition, they will be checked one after another.

This field appears when the Approval Type is equal to Manual.

Reject ConditionsY

Specify the conditions to be met for the Rejected exit. If there is more than one condition, they will be checked one after another.

This field appears when the Approval Type is equal to Manual.

Non-mandatory participants tab

This tab appears when the Non-Mandatory Participants checkbox is selected.
EmployeesN

Select responsible users from the Employee list. They will receive the approvals and make their decisions. Yet, their approval is not mandatory. Click the magnifier icon  to select from the list or start typing the user's name to select from autosuggest.

Groups

N

Select responsible groups. Users included in this group will receive the approvals and make their decisions. Yet, their approval is not mandatory. Click the magnifier icon  to select from the list or start typing the group name to select from autosuggest.

Roles

N

Select roles whose owners will receive the approvals and make their decisions. Yet, their approval is not mandatory. Click the magnifier icon  to select from the list or start typing the role name to select from autosuggest.

Advanced

NSelect this checkbox to specify a script to execute.
ScriptN

This script is called to determine if any additional approvals to be created.

The script is intended to set the answer variable to a comma-separated list of user IDs to add as approvers.

See an example and clarifications above.

This field appears when the Advanced checkbox is selected.

Consider Non-Mandatory Participants

N

When selected, non-mandatory participants are able to vote in approval tickets.


Subflows


The Subflow activity performs another workflow. This activity is useful for complex workflows that include other processes.

Subflow activity


The Subflow activity performs an existing workflow as part of the current workflow.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
WorkflowY

The published workflow to be performed by the activity. Click the magnifier icon  to see the list, or start typing the workflow name in the field to select from autosuggest.

DescriptionNType a brief description for the activity.

When a Subflow block is started, a workflow context is created for the current record. Until the context is finished, another Subflow block with the same workflow cannot be started, since at any given time only one workflow context can exist for the current record.

For example, a Subflow block referring to the "Request 2nd phase" workflow is configured in the main workflow. After the main workflow starts, the "Request 2nd phase" subflow is started. The subflow execution context is paused. If another attempt to launch the "Request 2nd phase" subflow is made within the main workflow, the subflow is created in the canceled state.

Timers


The Timer activity pauses the workflow. This activity is useful when the process requires waiting for a certain period.

Timer activity


The Timer activity defines a period of time during which the current workflow does not run. It follows the logic below:

  • If the workflow context is not finished and the block following the Timer block has the Finished state – the block processing is restarted.
  • If the workflow context is not finished and the block following the Timer block has the Waiting state – the block processing is not restarted.
  • If the workflow context at the moment of running of the Timer block is finished – processing of the block following the Timer block is not started.

Activity fields

FieldMandatoryDescription
NameNActivity name. A good practice is to make the name descriptive for clarity.
DescriptionNType a brief description of the activity.
Timer, based onY

The way the timer duration is calculated. Available options:

  • A User Specified Duration –  specify the duration of time to wait before proceeding to the next activity.
  • Script – specify a script for duration calculation.
DurationY

Specify the duration of time to wait in days, hours, minutes and seconds to wait before proceeding to the next activity.

This field appears when the A User Specified Duration option is selected in the Timer, based on field.

ScriptY

Specify the script implementing the duration calculation logic. Here, you can use the SimpleOne API methods.

This field appears when the Script option is selected in the Timer, based on field.

Schedule tab
Timezone, based onN

Specify a timezone source for this activity. Available options:

  • (No Time Zone)
  • A Specific Time Zone
TimezoneY

Select a timezone from the list. Click the magnifier icon  to see the list, or start typing the schedule name in the field to select from autosuggest.

This field appears when the Timezone, based on option is A Specific Time Zone.

Schedule, based onN

Specify a schedule source for this activity. Available options:

  • (No Schedule)
  • A Specific Schedule
ScheduleY

Select a schedule from the list. Click the magnifier icon  to see the list, or start typing the schedule name in the field to select from autosuggest.

This field appears when the Timezone, based on option is A Specific Schedule.



  • No labels