หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา
Creating a BPM
Function
This API is used to create a BPM.
URI
POST Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/metadata/definitions
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Explanation BPM name. Constraints None Value range Start with a letter and can contain only letters, digits, and single underscores (_). There is no consecutive underscore (_) and the value cannot end with an underscore (_). A maximum of 64 characters are allowed. Default value None |
label |
Yes |
String |
Explanation BPM label. Constraints None Value 1–80 characters Default value None |
description |
No |
String |
Explanation BPM description. Constraints None Value None Default value None |
version |
No |
String |
Explanation BPM version. When saving a BPM, you can save it as different versions. When enabling a BPM, you can select different versions. However, only one version can be enabled at a time. Constraints None Value None Default value None |
instanceLabel |
No |
String |
Explanation Label of the BPM instance, which can contain system variables. Constraints None Value None Default value None |
laneSet |
No |
object |
Explanation Lanes. A lane represents a user role in a BPM. Each lane in a BPM corresponds to a work queue. After a work queue is configured, diagram elements in different lanes are processed by users in different work queues. A work queue records a set of members with the same permissions and task objects. Constraints None |
config |
No |
object |
Explanation The basic configuration in a BPM determines whether a process or task is private (viewable only by the current owner), whether the process can be canceled, and whether it can be canceled after passing through a BPM node. Constraints None |
startEvents |
No |
Array of object |
Explanation Start diagram elements. The start diagram element, which serves as the start node of a BPM, includes properties such as the name of the next connected diagram element. Its default type is Start. Constraints None |
dataMappers |
No |
Array of object |
Explanation Data mappings. The data mapping diagram element is used to assign values to variables, fields, properties, and constants. For example, you can use this diagram to assign the value of a variable or constant to another variable. When the Data Mapper activity is reached in the process, the value assignment operation is performed. After values are assigned, the BPM execution continues along the subsequent route. Constraints None |
userTasks |
No |
Array of object |
Explanation User tasks. A user activity is used to indicate the work that is accomplished by the user in the BPM. When the engine reaches this node during processing, the engine creates a task item to be processed for a specified user (participant) or a group of users (for example, a working queue of a lane), and waits for the user to process the task item. You can configure the approval information, GUI rendering information, recipient information, pre- and post-actions, and data mapping of user tasks. Constraints None |
serviceTasks |
No |
Array of object |
Explanation Automatic task definition, which is the collection of configuration information about the script diagram element, flow diagram element, record creation diagram element, record query diagram element, record update diagram element, record deletion diagram element, and email diagram element.
Constraints None |
businessRuleTasks |
No |
Array of object |
Explanation Business rule tasks. This diagram element generates business rules based on the configuration in the decision table. Then, the system routes the messages to other element nodes based on the output connection gateway of the business rules. During the Business Rule task in the process, the system routes the messages to different route nodes according to the business rules. When using this diagram element, you need to select the decision table to be used. Constraints None |
callActivities |
No |
Array of object |
Explanation Call activities. Other BPMs can be nested in a BPM. When Call Activity is reached in the BPM, the system automatically executes the activity (calls another BPM). After the activity is executed, the BPM execution continues along the subsequent route. You can configure the properties of other BPMs, for example, the input and output parameters of the selected BPM. Constraints None |
subProcesses |
No |
Array of object |
Explanation Embedded subprocesses. The Call Activity and Sub Process diagram elements are embedded subprocesses of a BPM. The differences are as follows:
Constraints None |
sendEvents |
No |
Array of object |
Explanation Events to throw. When the Throw Signal event is reached during BPM execution, the engine sends an event to the system. Then, the BPM execution continues along the subsequent route. The thrown signal can be subscribed to and processed by the Signal Catch event. When using this element, you need to configure the specific event to be thrown, and configure event parameter in the Input Parameters area. Constraints None |
catchEvents |
No |
Array of object |
Explanation Capture events, which include the configuration information of the Timer Catch diagram element and Signal Catch diagram element.
Constraints None |
exclusiveGateways |
No |
Array of object |
Explanation Exclusive gateways. An exclusive gateway is used to make a unique decision for a group of branches in a process. The system evaluates the branch that flows out of the gateway based on the condition order. The process executes the first branch whose connection condition is evaluated as true (when multiple conditions are evaluated as true, the first decision is executed) and does not evaluate the subsequent branches. If all branch condition decisions are false and the gateway defines a default connection, the default branch is executed. If no reachable branch is available, an exception is thrown and the process is interrupted. Constraints None |
inclusiveGateways |
No |
Array of object |
Explanation Inclusive gateways. Inclusive gateways are a special type of parallel gateways. On the basis of parallel gateways, a condition can be configured for each connection line. All connection lines that meet the condition are executed in parallel. If no condition is met, the default branch is executed if it is configured. Each inclusive gateway should appear in pairs, starting from the inclusive divergent gateway and finally connecting to the aggregation gateway. Constraints None |
parallelGateways |
No |
Array of object |
Explanation Parallel gateways. Parallel gateways are used to combine branches unconditionally. Such gateways ignore connection conditions. A BPM can have multiple incoming and one outgoing branches, which are concurrently executed by the BPM engine. The parallel gateway appears in pairs. A pair of gateways can have multiple parallel branches. Constraints None |
eventGateways |
No |
Array of object |
Explanation Event gateways. Generally, the gateway determines the subsequent path based on the connection condition, which requires that the condition information exists in the process. However, if the conditions for selecting the subsequent path are not from the process, event-based gateways can be used. The event-based gateway has only the branch behavior. It allows the branch (such as a time event or message event) where the event reaches first to be selected from multiple candidate branches and the other branches to be cancelled. Constraints None |
slas |
No |
Array of object |
Explanation SLA. SLA: You can also set an SLA timer for the user activity. If the timer expires, the urgency level is increased and the corresponding action is performed. Constraints None |
constants |
No |
Array of object |
Explanation Constant definition, that is, constant information configured in Context. Constraints None |
variables |
No |
Array of object |
Explanation Variable definition, that is, variable information configured in Context. Constraints None |
endEvents |
No |
Array of object |
Explanation End event definition, indicating the natural end of a BPM or branch. If there are multiple execution branches, the BPM instance ends after the last branch ends naturally. Constraints None |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
resCode |
String |
Explanation Return code. Value If the request is successful, 0 is returned. For details about other error codes, see Error Codes. |
resMsg |
String |
Explanation Message returned. Value If the request is successful, "Success" is returned. In other cases, an error message is returned. |
result |
Object |
Explanation If the request is successful, an ID of the BPM instance is returned. If the request fails, an error and alarm information is returned. |
Example Request
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/bp/v2.0/metadata/definitions
{
"config": {
"cancelable": false,
"noCancelAfterElem": ""
},
"dataMappers": [
{
"assignmentItems": [
{
"assignTo": "dateList",
"name": "",
"operator": "add",
"value": "2019-03-04",
"valueType": ""
},
{
"assignTo": "dateList",
"name": "",
"operator": "add",
"value": "2020-01-02",
"valueType": ""
}
],
"connector": "userTask",
"connectorPoint": "{\"fromPort\":\"R1\",\"toPort\":\"L1\",\"points\":[\"619 125\",\"643 125\",\"662.5 125\",\"662.5 100\",\"682 100\",\"706 100\"]}",
"description": "",
"label": "Data Mapper",
"locationX": 575,
"locationY": 125,
"name": "dataMapper",
"connectors": []
}
],
"description": "",
"label": "SimpleBP",
"laneSet": {
"label": "",
"lanes": [
{
"elements": [
"userTask",
"userTask1",
"dataMapper",
"start"
],
"height": 201.35220031738282,
"label": "lane",
"name": "lane",
"role": "LoanRequest.Applicant",
"width": 1080
}
],
"name": ""
},
"name": "SimpleBP",
"slas": [
{
"active": true,
"criteria": "",
"deadlineDays": 0,
"deadlineHours": 0,
"deadlineIncreaseUrgencyBy": 2,
"deadlineMinutes": 0,
"deadlineOnlyBusinessDays": false,
"goalActions": [
{
"action": "",
"criteria": "{!IsMatched} && {!Owner}",
"name": "sla-act",
"type": "Notify Manager"
}
],
"goalDays": 0,
"goalHours": 0,
"goalIncreaseUrgencyBy": 1,
"goalMinutes": 0,
"goalOnlyBusinessDays": false,
"label": "userTask1_sla",
"name": "userTask1_sla",
"startWhen": "",
"variable": "",
"actions": []
},
{
"active": true,
"criteria": "",
"deadlineDays": 0,
"deadlineHours": 0,
"deadlineIncreaseUrgencyBy": 2,
"deadlineMinutes": 0,
"deadlineOnlyBusinessDays": false,
"goalActions": [
{
"action": "NotifyBPManager",
"criteria": "",
"name": "sla-act1",
"type": "Notify Manager"
}
],
"goalDays": 1,
"goalHours": 0,
"goalIncreaseUrgencyBy": 1,
"goalMinutes": 0,
"goalOnlyBusinessDays": false,
"label": "userTask_sla",
"name": "userTask_sla",
"startWhen": "",
"variable": "",
"actions": []
}
],
"startEvents": [
{
"connector": "dataMapper",
"connectorPoint": "{\"fromPort\":\"R1\",\"toPort\":\"L0\",\"points\":[\"151.5 100\",\"175.5 100\",\"341.25 100\",\"341.25 110.5\",\"507 110.5\",\"531 110.5\"]}",
"label": "Start",
"locationX": 125,
"locationY": 100,
"name": "start",
"type": "Start",
"startType": "",
"renderType": "",
"render": "",
"document": "",
"description": ""
}
],
"userTasks": [
{
"approvalType": "Single",
"connector": "userTask1",
"connectorPoint": "{\"fromPort\":\"R1\",\"toPort\":\"L1\",\"points\":[\"794 100\",\"818 100\",\"875 100\",\"875 100\",\"932 100\",\"956 100\"]}",
"description": "wuli desc",
"groupAsSingleParticipant": false,
"inputAssignments": [
{
"input": "$Task.Title",
"name": "",
"value": "{!$GlobalConstant.EmptyString}",
"valueType": ""
}
],
"label": "User Task",
"locationX": 750,
"locationY": 100,
"name": "userTask",
"participants": [
{
"type": "user",
"value": "ecommerce6"
}
],
"preActions": [
{
"action": "{!$GlobalConstant.EmptyString}",
"criteria": "",
"name": "action",
"type": "Set Status"
}
],
"render": "SimpleBP$Form1$form",
"renderType": "Form",
"routeType": "Name and Expressions",
"router": {
"defaultRouteTo": "",
"defaultRouteType": "",
"name": ""
},
"title": "wu li tu cao",
"usingSLA": "userTask_sla",
"routeTo": "",
"faultConnector": "",
"boundaryEvents": [],
"outputAssignments": [],
"document": "",
"priority": 3
},
{
"approvalType": "Single",
"groupAsSingleParticipant": false,
"label": "User Task",
"locationX": 1000,
"locationY": 100,
"name": "userTask1",
"priority": 3,
"render": "SimpleBP$ut1$form",
"renderType": "Form",
"routeType": "Last Assignee In Lane",
"router": {
"defaultRouteTo": "",
"defaultRouteType": "",
"name": ""
},
"title": "T2",
"routeTo": "",
"connector": "",
"faultConnector": "",
"boundaryEvents": [],
"inputAssignments": [],
"outputAssignments": [],
"document": "",
"description": ""
}
],
"variables": [
{
"currencyFactor": 0,
"dataType": "checkBox",
"defaultValue": "{!$GlobalConstant.True}",
"defaultValueType": "",
"description": "",
"extNS": "",
"extType": "",
"isCollection": false,
"isInput": false,
"isNested": false,
"isOutput": false,
"name": "IsMatched"
},
{
"currencyFactor": 0,
"dataType": "text",
"defaultValue": "Hello",
"defaultValueType": "",
"description": "",
"extNS": "",
"extType": "",
"isCollection": false,
"isInput": false,
"isNested": false,
"isOutput": false,
"name": "Owner"
},
{
"currencyFactor": 0,
"dataType": "date",
"defaultValue": "",
"defaultValueType": "",
"description": "",
"extNS": "",
"extType": "",
"isCollection": false,
"isInput": false,
"isNested": false,
"isOutput": false,
"name": "dateVar"
},
{
"currencyFactor": 0,
"dataType": "date",
"defaultValue": "",
"defaultValueType": "",
"description": "",
"extNS": "",
"extType": "",
"isCollection": true,
"isInput": false,
"isNested": false,
"isOutput": false,
"name": "dateList"
},
{
"currencyFactor": 0,
"dataType": "extStruct",
"defaultValue": "",
"defaultValueType": "",
"description": "",
"extNS": "SimpleBP",
"extType": "Form1Form",
"isCollection": false,
"isInput": false,
"isNested": false,
"isOutput": false,
"name": "Form1Form"
}
],
"version": "1.0.1",
"constants": [],
"serviceTasks": [],
"businessRuleTasks": [],
"callActivities": [],
"subProcesses": [],
"endEvents": [],
"sendEvents": [],
"catchEvents": [],
"exclusiveGateways": [],
"parallelGateways": [],
"eventGateways": [],
}
Example Response
{
"resCode": "0",
"resMsg": "Success",
"result": {
"errors": [],
"id": "000y000000aM8XixTN0S",
"warnings": []
}
}
Status Code
See Status Codes.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot