CreateProcessDefinition

Updated at:

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

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  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 rule conditions.

object

No

The rule.

Type

string

No

The condition type. Valid values:

  • odpsProject

  • hologresInstanceId

  • sensibleLevel

  • tableGuid

  • projectId

odpsProject

Scope

string

No

The stage in which the rule takes effect. Valid values:

  • Deployment: Used to determine whether the approval policy is matched when an application is submitted.

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

Deployment

Expression

string

No

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

Channel

string

No

The notification channel. Valid values:

  • Mail

  • Sms

  • DingRobot

  • Weixin

DingRobot

Extension

string

No

The extended information in JSON format. For example, {"atAll":"true"} specifies whether to mention all members.

{"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:

  • DataWorksProjectRole: workspace role

  • DataWorksProjectMember: workspace member

  • TableAdministrator: table owner

  • TableOrProjectAdministrator: table or workspace administrator

  • AliyunResourceOwner: Alibaba Cloud account

  • MaxComputeRole: MaxCompute administrator

  • DLFAdmin: DlfLegacy administrator

  • DLFNextAdmin: DLFNext administrator

  • TenantRole: tenant role

  • EmrAdministrator: EMR administrator

  • LindormAdministrator: Lindorm administrator

  • AliyunRamUser: RAM user

TableOrProjectAdministrator

Assignees

array

No

The assignees. The semantics vary based on the value of AccountType:

  • DataWorksProjectMember: specifies the user ID of the workspace member.

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

  • MaxComputeRole: specifies the MaxCompute role.

  • TenantRole: specifies the code of the tenant role.

  • AliyunRamUser: specifies the RAM user ID.

string

No

The approver.

213463068144525171

ExtensionProperties

object

No

The extension properties. Different additional declarations are required based on the value of AccountType:

  • DataWorksProjectMember: You must set the user IDs of different workspace members.

    • The key is the workspace ID, and the value is the user ID of the workspace member. Separate multiple values with commas (,).

  • DataWorksProjectRole: You must set the codes of different custom workspace roles.

    • The key is the workspace ID, and the value is the code of the custom workspace role. Separate multiple values with commas (,).

  • MaxComputeRole: You must set the roles under the MaxCompute project.

    • The key is the MaxCompute project, and the value is the role name in MaxCompute. Separate multiple values with commas (,).

{"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.