Approval - Group workflow activity
The Approval - Group activity creates approval records for each member of a specified group.
Note: This activity is only available when the workflow runs on a table that extends Task.
The group approval is approved or rejected based on the user approvals, according to the logic specified in the Wait For field.
Results
The workflow designer can assign a result value using activity.result from within a script field of the activity. By default, the result value is the final approval disposition. This disposition depends on the approval actions take by the approvers and the approval conditions specified in the Wait for or When Anyone Rejects fields. Possible result values are:
- Approved
- Rejected
- Deleted
- Cancelled
Input variables
Input variables determine the initial behavior of the activity.
| Field | Description |
|---|---|
| Approval - Group When Specify when this activity generates a group approval record. | |
| Condition | Conditions which, if met, cause the group approval to be generated. If the conditions are not met, the approval is skipped. |
| Approval - Group Approvers Specify the groups whose approval will be requested. | |
| Groups | The groups whose approval will be requested.To edit this field, click the lock icon. To select specific groups by name, use the lookup list. To select groups from field values on the current record at runtime, click the tree icon. Each member of the group will be assigned an individual approval record. If no group is selected, the activity automatically sets the approval to Approved. |
| Approval - Group Condition Specify how the activity decides to approve or reject the group approval, based on the responses from individual members of the group. | |
| Wait for | A choice between different approval logics to determine which individual approvals or rejections result in approval or rejection of the activity's approval. Options are:
Indicate what happens when any user rejects their approval request. Options are:
|
Approval scriptOnly appears when Wait for is set to Condition based on script. | If the Wait for variable is set to Condition based on script this script is called to determine how to handle an approval or rejection. The script needs to set the variable answer to approved or rejected to indicate the overall status for this approval. This script is responsible for setting the approval state for each group that is part of this approval activity before returning the overall approval state for all of the groups. When called, the following variables are available to the script for all the groups that are part of this approval activity: ``` counts.total = total number of groups that are part of this approval counts.approved = # of groups that approved so far counts.rejected = # of groups that rejected so far counts.requested = # of groups that are pending approval counts.not_requested = # of groups that are not pending approval counts.not_required = # of groups that approval is not required
|
| When anyone rejects | A choice between different approval logics to determine which individual rejections result in rejection of the activity's approval. Options are:
Note: If Wait for is set to Anyone to approve, then a single approval causes the activity to complete with a result of approved, even if one or more users reject. |
| Approval - Group Schedule Specify how workflow calculates the approval record's expected start date and due date. Once you've made a selection for 'Due date based on', and 'Schedule based on', the appropriate fields will display. | |
| Due date based on | Select how workflow determines the task's duration, due date, and schedule. - A user specified duration: The duration is based on a user specified value. - A relative duration: The duration is calculated from a relative duration (such as End of Next Business Day). - A date/time or duration field: The duration is based on the value of a field on the current record. - Script: The duration is returned by a script. |
Duration Only appears when Due date based on is set to A user specified duration | The specific number of days and hours. |
Relative durationOnly appears when Due date based on is set to A relative duration | The general number and length of business days. |
Due date fieldOnly appears when Due date based on is set to A date/time or duration field | The date/time or duration field. |
Due date scriptOnly appears when Due date based on is set to Script | The script that sets 'answer' to the number of seconds for the duration. |
| Schedule based on | The basic schedule the timer uses to count working hours. If a schedule is specified, the duration will only be considered for times that are specified on the schedule. For example, if the duration is 2 hours and the workflow begins at 4:00pm on a schedule that is 8am - 5pm, then it ends at 9:00am the next day. The options are: - This workflow's schedule: The schedule uses workflow context date, time, and an optional Time zone based on value. - A specific schedule: The schedule uses a pre-defined Schedule and an optional Time zone based on value. - A schedule field: The schedule uses a value from a table and an optional Time zone based on value. |
ScheduleOnly appears when Schedule based on is set to A specific schedule | The predefined Schedule from a list. |
Schedule fieldOnly appears when Schedule based on is set to A schedule field. | A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog. |
| Time zone based on | The time zone for calculating the duration. The time zone may be based on:- No time zone: Default. Workflow uses the GMT time zone. - A specific time zone: A specific Time zone that you choose from a choice list. - A time zone field: A Time zone field to track time duration from a field on the form. |
Time zoneOnly appears when Time zone based on is set to . | Select the time zone you want from the choice list. |
Time zone fieldOnly appears when Time zone based on is set to A time zone field. | A date and time or duration field for the schedule, that is associated with the table. Valid fields appear in blue on the Select the element from a tree dialog. |
| Approval - Advanced If desired, write a script for determining additional users to request approvals from. | |
| Advanced | Select this check box to write a script for determining additional users to request approvals from. Use the Additional groups script to customize group approvals. |
| Additional groups script | If the Advanced check box is selected, this script is called to determine any additional group approvals to be created. The script needs to set the variable answer to a comma-separated list of group ids or an array of group ids to add as approver groups. For example: |
Conditions
The following conditions determine which transition runs after this activity.
Note: Approval activities run as the user whose actions match the approve or reject conditions the workflow was waiting for and advances the workflow.
| Condition | Description |
|---|---|
| Approved | The users from the groups have approved the request based on the Wait for rules. |
| Rejected | The users from the groups have rejected the request based on the Wait for rules. |
| Error | The event or condition that generates an error. |
| Skipped | The event or condition that allows a skipped approval. |
States
The activity state tells the workflow engine what to do with the activity.
| State | Description |
|---|---|
| Executing | The workflow engine starts the execute function of the activity. |
| Waiting | The workflow engine ignores the activity until a specific event to restart the activity is fired. |
| Finished | The activity finished running. See the result value for the outcome of the activity. |
| Cancelled | This activity, or the workflow that contains this activity, was canceled. |
| Error | A JavaScript error occurred. Review the logs for error details. |
Parent Topic:Approval and rollback workflow activities