PDAutomationProvider - Scoped, Global
-
- UpdatedJan 30, 2025
- 7 minutes to read
- Yokohama
- API reference
The PDAutomationProvider API enables inserting an optional activity into a process while it's executing.
This API is part of the Playbooks plugin (com.glide.pad.core) and runs in the sn_pad
namespace.
- The caller must be in the same scope in which the optional activity trigger was created.
- Admin privileges.
A process is a series of activities ordered by lanes. An optional activity is predefined during process design. The activities aren't scheduled to run at a precise time. An activity can be assigned to a lane and made available to run during lane execution. An activity can be assigned to a process and made available to run during lane execution.
To create an optional activity, it must have the Start rule set to Manual in the Activities [sys_pd_activity] table. Playbooks doesn't currently support creating manual activities.
An agent adds the optional activity to a lane or activity relative to another activity. The process must be running to insert an optional activity.
PDAutomationProvider – activateProcess(String processDefinitionSysId)
Activates a playbook.
Name | Type | Description |
---|---|---|
processDefinitionSysId | String | Sys_id of a playbook. Table: Process Definitions [sys_pd_process_definition] |
Example
The following example shows how to activate a playbook.
Output:PDAutomationProvider – addOptionalActivityRelativeToActivityContext(String contextID, String activityId, String where, String relativeToId)
Adds a specified optional activity to a process to be run relative to another activity during process execution.
An activity context is created for each activity when a process executes. The context also handles how the activity handles execution. For information, see Process Automation Designer lanes and activities.
Type | Description |
---|---|
Boolean | Flag that indicates whether the activity was successfully scheduled to run.
Possible values:
If errors, list of one or more error messages. Message stating Array of 0 or more elements otherwise. |
Array | If errors, list of one or more error messages.
Message stating Array of 0 or more elements
otherwise.
Possible error messages:
|
Example
The following example shows how to run an optional activity simultaneously with the relative activity context.
PDAutomationProvider – addOptionalActivityRelativeToLaneContext(String contextID, String activityId, String where, String relativeToId)
Assigns an optional activity to a lane to run during that lane's execution context.
A lane context is created for each lane when a process executes. The context also handles how the lane handles execution. For information, see Process Automation Designer lanes and activities.
Type | Description |
---|---|
Boolean | Flag that indicates whether the activity was successfully scheduled to run.
Possible values:
|
Array | If errors, list of one or more error messages.
Message stating Array of 0 or more elements
otherwise.
Possible error messages:
|
Example
The following example shows how to run an optional activity as the final activity in a lane context.
PDAutomationProvider – deactivateProcess(String processDefinitionSysId)
Deactivates a playbook.
Name | Type | Description |
---|---|---|
processDefinitionSysId | String | Sys_id of a playbook. Table: Process Definitions [sys_pd_process_definition] |
Example
Deactivate the playbook.
Outputs:
PDAutomationProvider – duplicateProcess(String processDefinitionSysId, String label, String description, String scopeId, String triggerTypeId)
Duplicates a playbook.
Example
This example shows how to duplicate a playbook with the sys_id f8ca6192ec210210f8772cbd595eab20
. The new playbook is named Playbook 2.0, has an application scope of
Global, and is triggered when a record is created. The Record Create trigger type has a sys_id of ab6951170f1200108c87f4f0ff767e4f
.
Output:
On this page
- PDAutomationProvider – activateProcess(String processDefinitionSysId)
- PDAutomationProvider – addOptionalActivityRelativeToActivityContext(String contextID,
String activityId, String where, String relativeToId)
- PDAutomationProvider – addOptionalActivityRelativeToLaneContext(String contextID, String
activityId, String where, String relativeToId)
- PDAutomationProvider – deactivateProcess(String processDefinitionSysId)
- PDAutomationProvider – duplicateProcess(String processDefinitionSysId, String label, String description, String scopeId, String triggerTypeId)