This activity
...
configures the process of approving: it creates approvals, sets approval rules and conditions.
...
Excerpt |
---|
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. Image Added
Activity fields Name | Mandatory | Description |
---|
Name | N |
|
...
Activity name. A good practice is to make the name descriptive for clarity. | Description | N |
|
...
Type a brief description of the activity. It is displayed on the activity block on the canvas if provided. | Table | Y |
|
...
...
affected by this activity. This field is populated automatically. | Run Conditions | N | 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 Type | N | Specify the approval type |
|
...
to define the conditions of the |
|
...
activity exits. Available options: |
|
...
- – 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 Participants | N | 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 |
---|
Employees | N | |
|
...
responsible users. They will receive the approvals and make their decisions. Click the magnifier icon Image Added to select from the list or start typing the user name to select from autosuggest. | Groups | N |
|
...
Select responsible groups. Users included in this group will receive the approvals and make their decisions. Click the magnifier icon Image Added 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. Click the magnifier icon Image Added to select from the list or start typing the role name to select from autosuggest. | Advanced | N | Select this checkbox to specify a script to |
|
...
execute. | Script Anchor |
---|
| script examples for approvals |
---|
| script examples for approvals |
---|
|
|
|
...
| 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. Info |
---|
This field appears when the Advanced checkbox is selected. |
The code example below implements logic as described below: - Checks groups of the current caller.
- Checks the value of the Responsible attribute of these groups.
- If the group responsible was found, then his user ID is added to the answer array.
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | Script example |
---|
linenumbers | true |
---|
| const |
|
|
...
caller = current.getValue('caller');
const |
|
|
...
callerGroup = new SimpleRecord('sys_user_group');
|
|
|
...
callerGroup.addQuery('user_id', |
|
|
...
...
callerGroup.selectAttributes( |
|
|
...
...
...
callerGroup.query();
while ( |
|
|
...
...
...
...
...
...
...
getValue('responsible')) {
answer = |
|
|
...
callerGroups.group_id.getValue('responsible') |
|
|
...
...
Note |
---|
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 When |
|
...
This field is displayed when the Approval Type is chosen to "Automatically".
In this field, you can define the approval logic. Available choice options: |
|
...
- 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
|
|
...
...
- 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.
|
|
...
when the Approval Type is |
|
|
...
...
| Approval Conditions | Y | Specify the conditions to |
|
...
be met for the Approved exit. If there is more than one condition, |
|
...
...
be checked one after another. |
|
...
...
appears when the Approval Type is |
|
|
...
...
| Reject Conditions | Y | Specify the conditions to |
|
...
be met for the Rejected exit. If there is more than one condition, |
|
...
...
be checked one after another. Info |
---|
This field appears when the Approval Type is equal to Manual. |
| Non-mandatory participants tab Info |
---|
This tab appears when the Non-Mandatory Participants checkbox is selected. |
|
|
...
Non-mandatory participants tab. This tab appears when you select the Non-Mandatory Participants checkbox
...
Groups
...
Roles
...
Advanced
...
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
...
When selected, non-mandatory participants are able to vote in approval tickets.
Excerpt |
---|
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 fieldsName | Mandatory | Description |
---|
Name | N | Customized activity name. | Description | N | Brief activity description. It is displayed on the activity block on the canvas if provided. | Table | Y | Select a table to be processed by this activity. | Run Conditions | N | Specify conditions that must be met for generating approvals; whenever they are not met, then the activity is skipped. | Approval Type | N | 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 Participants | N | Select 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 a person or persons dictionary. These ones are recipients of the approvals.Groups | N | Specify a group or groups whose members will be the approvers. | Roles | N | Specify a role or roles whose owners will be the approvers. | Advanced | N | Select this checkbox to specify a script to evaluate. | Script | N | 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: - Checks groups of the current caller.
- Checks the value of the Responsible attribute of these groups.
- If the group responsible was found, then his user ID is added to the answer array.
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | Script example |
---|
linenumbers | true |
---|
| 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'))
}
} |
Note |
---|
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' |
Employee list. They will receive the approvals and make their decisions. Yet, their approval is not mandatory. Click the magnifier icon Image Added 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 Image Added 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 Image Added to select from the list or start typing the role name to select from autosuggest |
When Approved | N | 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 Approved | Y | 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 Rejected | Y | 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 |
---|
Employees | N | Specify the employees who are participants of the approval process but their approval is not mandatory. | Groups | N | Specify the groups whose members are participants of the approval process but their approval is not mandatory. | Roles | N | Specify the roles whose owners are participants of the approval process but their approval is not mandatory | Advanced | N | Select this checkbox to specify a script to | evaluateIf the Advanced checkbox is selected, then this 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. Info |
---|
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. |
|