CreateProcessDefinition
Creates an approval process definition with custom approval rules and notification services.
Operation description
Before you begin
Activate DataWorks in the target region and call this operation by using an identity that has the permission to manage approval policies in the current tenant. The process definition is created in the tenant to which the calling identity belongs.
Request description
This operation allows you to create an approval process definition, including settings such as the policy name, description, type, and subtype.
You can define a list of rule conditions (RuleConditions) to specify the conditions under which the approval process is triggered.
You can configure multiple notification services (NotificationServices) to send notifications to relevant personnel at different stages of the approval process.
The list of approval nodes (ApprovalNodes) defines the nodes that the approval process must pass through and the approver information for each node.
The approval process definition is enabled immediately after it is created. To disable it, you can call DisableProcessDefinition by using the returned Id.
Note: Some fields, such as Type, have specific value limits. Refer to the constraint description section in the documentation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateProcessDefinition |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the process definition. |
My approval policy |
| Description |
string |
Yes |
The description of the process definition. |
This is a sample policy |
| Type |
string |
No |
The type of the process definition. Valid values:
|
Extension |
| SubType |
string |
No |
The subtype. Valid values:
|
Table |
| Enabled |
boolean |
No |
Specifies whether to enable the process definition. |
|
| RuleConditions |
array<object> |
Yes |
The list of rule conditions. |
|
|
object |
No |
The rule. |
||
| Type |
string |
No |
The condition type. Valid values:
|
odpsProject |
| Scope |
string |
No |
The stage in which the rule takes effect. Valid values:
|
Deployment |
| Expression |
string |
No |
The conditional expression, in the format of |
((#odpsProject=='PX_BEIJING_TEST')) |
| NotificationServices |
array<object> |
No |
The notification service declarations. |
|
|
object |
No |
The notification service declarations. |
||
| Channel |
string |
No |
The notification channel. Valid values:
|
DingRobot |
| Extension |
string |
No |
The extended information in JSON format. For example, |
{"atAll":"true"} |
| Receiver |
string |
No |
The receiver. When Channel is set to DingRobot or Weixin, you must specify WebhookUrl. |
https://dingtalk.com |
| ApprovalNodes |
array<object> |
Yes |
The list of approval nodes. |
|
|
array<object> |
No |
The node. |
||
| Name |
string |
No |
The name of the node. |
default-name |
| AccountType |
string |
No |
The node approver type. Valid values:
|
TableOrProjectAdministrator |
| Assignees |
array |
No |
The assignees. The semantics vary based on the value of AccountType:
|
|
|
string |
No |
The approver. |
213463068144525171 |
|
| ExtensionProperties |
object |
No |
The extension properties. Different additional declarations are required based on the value of AccountType:
|
{"449656": "role_project_admin,role_project_pe"} |
|
any |
No |
The extension description. |
{ "449656": "role_project_admin,role_project_pe" } |
|
| ClientToken |
string |
No |
The client token that is used to ensure idempotence. Use a UUID. |
0000-ABCD-EFG**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The API request ID. |
0bc5df3a17***903790e8e8a |
| Id |
string |
The ID of the process definition. |
1010543619 |
Examples
Success response
JSON format
{
"RequestId": "0bc5df3a17***903790e8e8a",
"Id": "1010543619"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.