CreateProcessDefinition

更新时间:
复制 MD 格式

Creates a new approval process definition, supporting custom configuration of approval rules and notification services.

Operation description

Usage notes

  • This API operation allows you to create a new approval process definition, including setting basic information such as the approval policy name, description, type, and subtype.

  • You can define a list of condition rules (RuleConditions) to specify the conditions under which the approval process is triggered.

  • Multiple notification services (NotificationServices) can be configured to send notifications to relevant personnel at different stages of the approval process.

  • The approval node list (ApprovalNodes) defines the nodes that must be traversed during the approval process and the approver information for each node.

  • You can choose whether to immediately enable the newly created approval process definition.

  • Note: Certain fields such as Type have specific value constraints. Refer to the constraint descriptions in the documentation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Name

string

Yes

The name of the process definition.

我的审批策略

Description

string

Yes

The description of the process definition.

这是一个示例策略

Type

string

No

The type of the process definition. Valid values:

  1. MaxCompute

  2. DataService

  3. Extension

  4. Hologres

Extension

SubType

string

No

The subtype. Valid values:

  • Table

  • Column

  • Database

  • Schema

  • Default

Table

Enabled

boolean

No

Specifies whether to enable the process definition.

RuleConditions

array<object>

Yes

The list of condition rules.

object

No

The rule.

Type

string

No

The condition type. Valid values:

  • odpsProject

  • hologresInstanceId

  • sensibleLevel

  • tableGuid

  • projectId

odpsProject

Scope

string

No

The stage at which the rule takes effect:

  • Deployment: used to determine whether the approval policy matches when a request is submitted.

  • Running: used to determine whether approval is exempted during the execution of the approval process. This value is supported only for the MaxCompute type.

Deployment

Expression

string

No

The condition expression in the format of ((#type=='typeValue')). Example: ((#odpsProject=='PX_BEIJING_TEST')).

((#odpsProject=='PX_BEIJING_TEST'))

NotificationServices

array<object>

No

The notification service declarations.

object

No

The notification service declaration.

Channel

string

No

The notification channel. Valid values:

  • Mail

  • Sms

  • DingRobot

  • Weixin

DingRobot

Extension

string

No

The extension information in JSON format. Example: {"atAll":"true"}, which specifies whether to mention all members.

{"atAll":"true"}

Receiver

string

No

The WebhookUrl that must be specified when Channel is set to DingRobot or Weixin.

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 type of approver for the node:

  • DataWorksProjectRole: workspace role.

  • DataWorksProjectMember: workspace member.

  • TableAdministrator: table owner.

  • TableOrProjectAdministrator: table or workspace administrator.

  • AliyunResourceOwner: Alibaba Cloud account.

  • MaxComputeRole: MaxCompute administrator.

  • DLFAdmin: DLF Legacy administrator.

  • DLFNextAdmin: DLF Next administrator.

  • TenantRole: tenant role.

  • EmrAdministrator: EMR administrator.

  • LindormAdministrator: Lindorm administrator.

  • AliyunRamUser: RAM user.

TableOrProjectAdministrator

Assignees

array

No

The semantics of this parameter varies based on the value of AccountType:

  • DataWorksProjectMember: the user ID of the workspace member.

  • DataWorksProjectRole: the code of the workspace role. If a custom workspace role is required, set this parameter to "custom-role" and further configure the role in ExtensionProperties.

  • MaxComputeRole: the MaxCompute role.

  • TenantRole: the code of the tenant role.

  • AliyunRamUser: the RAM user ID.

string

No

The approver.

213463068144525171

ExtensionProperties

object

No

The additional declarations required based on the value of AccountType:

  • DataWorksProjectMember: specify different workspace member user IDs. The key is the workspace ID, and the value is the user ID of the workspace member. Separate multiple user IDs with commas (,).

  • DataWorksProjectRole: specify different custom workspace role codes. The key is the workspace ID, and the value is the custom workspace role code. Separate multiple role codes with commas (,).

  • MaxComputeRole: specify the roles under a MaxCompute project. The key is the MaxCompute project name, and the value is the role name in MaxCompute. Separate multiple role names with commas (,).

any

No

The extension description.

{ "449656": "role_project_admin,role_project_pe" }

ClientToken

string

No

The idempotency token. We recommend that you use a UUID.

0000-ABCD-EFG****

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The 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.