You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Next »

This activity creates user approval(s) when executed, one or more, depending on the parameters specified.

The result value is the final approval disposition that depends on the actions taken by the approvers and the approval conditions specified in the When Approved and When Rejected 

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


Activity fields


NameMandatoryDescription
NameNCustomized activity name.
DescriptionNBrief activity description. It is displayed on the activity block on the canvas if provided.
TableYSelect a table to be processed by this activity.
Run ConditionsN

Specify conditions that must be met for generating approvals; whenever they are not met, then the activity is skipped.

Approval TypeN

Specify the approval type (here you can define conditions of the block exit, i.e. activity completing). Available options:

  • Automatically – specify the conditions of the activity completing in the When approved field manipulating with approval tickets.
  • Manual – specify the conditions of the activity completing in the Conditions approved field manipulating with the object fields and their values.
Non-Mandatory ParticipantsNSelect this checkbox to authorize the participants whose approvals are not mandatory to vote. When this checkbox is selected, the Non-Mandatory Participants tab appears.
Mandatory participants tab
EmployeesNSelect a responsible person or persons from the dictionary. These ones are recipients of the approvals.
GroupsNSpecify a group or groups whose members will be the approvers.
RolesNSpecify a role or roles whose owners will be the approvers.
AdvancedNSelect this checkbox to specify a script to evaluate.
ScriptN

If the Advanced checkbox is selected, then 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.

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 incidentCaller = current.getValue('caller')
const callerGroupsIds = []
const callerIsMemberOfGroups = new SimpleRecord('sys_user_group')
callerIsMemberOfGroups.addQuery('user_id', incidentCaller)
callerIsMemberOfGroups.selectAttributes(['group_id'])
callerIsMemberOfGroups.query()
while (callerIsMemberOfGroups.next()) {
    callerGroupsIds.push(callerIsMemberOfGroups.getValue('group_id'))
}
const callerGroups = new SimpleRecord('sys_group')
callerGroups.addQuery('sys_id', 'IN', callerGroupsIds)
callerGroups.selectAttributes(['responsible'])
callerGroups.query()
while (callerGroups.next()) {
    if (callerGroups.getValue('responsible')) {
        answer.push(callerGroups.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'

When ApprovedN

This field is displayed when the Approval Type is chosen to "Automatically".

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

  • Anyone to approve – any user can approve; the first received approval causes the activity to complete with the result of Approved.
  • Everyone to approve – all the users must approve; otherwise, the activity will not proceed further.
  • First response from anyone – when selected this option, the first response from any user will complete the activity.
  • Most answers - when selected this option, the activity will be completed with the Approved result if there were received more approvals than rejects.
  • Conditions based on script – each time a user approves or rejects, the Script is called to determine if the activity should complete.
Conditions ApprovedY

This field is displayed when the Approval Type is chosen to "manual".

Specify the conditions to meet before the activity will complete with the result of Approved. If you have specified more than one condition, then they will proceed downhill.

Conditions RejectedY

This field is displayed when the Approval Type is chosen to "manual".

Specify the conditions to meet before the activity will complete with the result of Rejected. If you have specified more than one condition, then they will proceed downhill.

Non-mandatory participants tab. This tab appears when you select the Non-Mandatory Participants checkbox

EmployeesNSpecify the employees who are participants of the approval process but their approval is not mandatory.

Groups

NSpecify the groups whose members are participants of the approval process but their approval is not mandatory.

Roles

NSpecify the roles whose owners are participants of the approval process but their approval is not mandatory.

Advanced

NSelect this checkbox to specify a script to evaluate.
ScriptN

If the Advanced checkbox is selected, then 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.

Consider Non-Mandatory Participants

N

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

This activity creates user approval(s) when executed, one or more, depending on the parameters specified.

The result value is the final approval disposition that depends on the actions taken by the approvers and the approval conditions specified in the When Approved and When Rejected 

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


Activity fields


NameMandatoryDescription
NameNCustomized activity name.
DescriptionNBrief activity description. It is displayed on the activity block on the canvas if provided.
TableYSelect a table to be processed by this activity.
Run ConditionsN

Specify conditions that must be met for generating approvals; whenever they are not met, then the activity is skipped.

Approval TypeN

Specify the approval type (here you can define conditions of the block exit, i.e. activity completing). Available options:

  • Automatically – specify the conditions of the activity completing in the When approved field manipulating with approval tickets.
  • Manual – specify the conditions of the activity completing in the Conditions approved field manipulating with the object fields and their values.
Non-Mandatory ParticipantsNSelect this checkbox to authorize the participants whose approvals are not mandatory to vote. When this checkbox is selected, the Non-Mandatory Participants tab appears.
Mandatory participants tab
EmployeesNSelect a responsible person or persons from the dictionary. These ones are recipients of the approvals.
GroupsNSpecify a group or groups whose members will be the approvers.
RolesNSpecify a role or roles whose owners will be the approvers.
AdvancedNSelect this checkbox to specify a script to evaluate.
ScriptN

If the Advanced checkbox is selected, then 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.

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 incidentCaller = current.getValue('caller')
const callerGroupsIds = []
const callerIsMemberOfGroups = new SimpleRecord('sys_user_group')
callerIsMemberOfGroups.addQuery('user_id', incidentCaller)
callerIsMemberOfGroups.selectAttributes(['group_id'])
callerIsMemberOfGroups.query()
while (callerIsMemberOfGroups.next()) {
    callerGroupsIds.push(callerIsMemberOfGroups.getValue('group_id'))
}
const callerGroups = new SimpleRecord('sys_group')
callerGroups.addQuery('sys_id', 'IN', callerGroupsIds)
callerGroups.selectAttributes(['responsible'])
callerGroups.query()
while (callerGroups.next()) {
    if (callerGroups.getValue('responsible')) {
        answer.push(callerGroups.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'

When ApprovedN

This field is displayed when the Approval Type is chosen to "Automatically".

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

  • Anyone to approve – any user can approve; the first received approval causes the activity to complete with the result of Approved.
  • Everyone to approve – all the users must approve; otherwise, the activity will not proceed further.
  • First response from anyone – when selected this option, the first response from any user will complete the activity.
  • Most answers - when selected this option, the activity will be completed with the Approved result if there were received more approvals than rejects.
  • Conditions based on script – each time a user approves or rejects, the Script is called to determine if the activity should complete.
Conditions ApprovedY

This field is displayed when the Approval Type is chosen to "manual".

Specify the conditions to meet before the activity will complete with the result of Approved. If you have specified more than one condition, then they will proceed downhill.

Conditions RejectedY

This field is displayed when the Approval Type is chosen to "manual".

Specify the conditions to meet before the activity will complete with the result of Rejected. If you have specified more than one condition, then they will proceed downhill.

Non-mandatory participants tab. This tab appears when you select the Non-Mandatory Participants checkbox

EmployeesNSpecify the employees who are participants of the approval process but their approval is not mandatory.

Groups

NSpecify the groups whose members are participants of the approval process but their approval is not mandatory.

Roles

NSpecify the roles whose owners are participants of the approval process but their approval is not mandatory.

Advanced

NSelect this checkbox to specify a script to evaluate.
ScriptN

If the Advanced checkbox is selected, then 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.

Consider Non-Mandatory Participants

N

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

  • No labels