El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Configuring a Conditional Branch Operator

Updated on 2024-12-18 GMT+08:00

The Conditional Branch operator obtains the request parameters or result sets of its upstream operator for condition judgment and determines the next branch to be executed based on the defined expression. If the conditions of multiple branches are met, only the first branch is executed.

Table 1 Conditional Branch operator parameters

Parameter

Description

Branch 1

Condition Type

Condition type.
  • Meets the current condition: When data transferred to the conditional branch meets the specified expression, the branch is executed.
  • Does not meet other conditions: When data transferred to the conditional branch does not meet the conditions of any other branch, the branch is executed.

Expression

This parameter is mandatory when Condition Type is Meets the current condition.

The expression consists of the code and variable name of the upstream operator. For details about how to use the expression, see Defining an Expression.

Branch 2

Condition Type

Condition type.
  • Meets the current condition: When data transferred to the conditional branch meets the specified expression, the branch is executed.
  • Does not meet other conditions: When data transferred to the conditional branch does not meet the conditions of any other branch, the branch is executed.

Expression

This parameter is mandatory when Condition Type is Meets the current condition.

The expression consists of the code and variable name of the upstream operator. For details about how to use the expression, see Defining an Expression.

...

Branch n

Condition Type

Condition type.
  • Meets the current condition: When data transferred to the conditional branch meets the specified expression, the branch is executed.
  • Does not meet other conditions: When data transferred to the conditional branch does not meet the conditions of any other branch, the branch is executed.

Expression

This parameter is mandatory when Condition Type is Meets the current condition.

The expression consists of the code and variable name of the upstream operator. For details about how to use the expression, see Defining an Expression.

Defining an Expression

When defining the expression of a conditional branch, you need to configure a variable expression. Variable expressions are available for Entry API and Common API operators, but unavailable for Conditional Branch, Parallel Processing, and Output Processing operators. The standard expression format is ${Node code|Variable name}. For details about how to define an expression, see Table 2.

  • Node code: It is dynamically allocated by the system and cannot be changed. You can click a node in the API orchestration canvas to view the node code and click to copy the node code.
    Figure 1 Viewing the node code

  • Variable name: Supported variables include request parameter values and result set parameters. For details, see Table 2.
Table 2 Methods for defining a condition expression

Operator

Variable Expression

Example Value

Entry API

Obtain the value of the request parameter of the entry API: ${Node code|Input parameter name}.
NOTE:

This expression is supported for POST requests whose input parameters are located in Query, Header, Path, or Body.

If the node code of the entry API is EntryApi_3909f, and the input parameter userId is located in Path, set the expression for obtaining the value of the request parameter to ${EntryApi_3909f|userId}.

Common API

  1. Obtain the value of the request parameter of the common API: ${Node code|Input parameter name}.
    NOTE:

    This expression is supported for POST requests whose input parameters are located in Query, Header, Path, or Body.

  2. Obtain the result sets and related variables of common APIs:
    • ${Node code|payload.success}: checks whether the query status of a common API is successful. The result is true or false.
    • ${Node code|payload.rowSize}: obtains the number of rows in the query result set of a common API.
    • ${Node code|payload.columnSize}: obtains the number of columns in the query result set of a common API.
    • ${Node code|payload.columnNames}: obtains the column names in the query result set of a common API.
    • ${Node code|payload.data[n-1].id}: obtains the value of row n in the id column in the query result set of a common API.
  • If the node code of a common API is NormalApi_4246f, and the input parameter userId is located in Path, set the expression for obtaining the value of the request parameter to ${NormalApi_4246f|userId}.
  • If the node code of a common API is NormalApi_4246f, and the value is a one-dimensional array of multiple rows and a single column, set the expression for obtaining the values of the first row in the result set to ${NormalApi_4246f|payload.data[0]}.
  • If the node code of a common API is NormalApi_4246f, and the value is a two-dimensional array of multiple rows and columns, set the expression for obtaining the value in the first row and price column in the result set to ${NormalApi_4246f|payload.data[0].price}.

For example, if there are three sequential nodes, A (entry API), B (common API), and C (conditional branch), and node C needs to obtain the request parameter values of node A and the output values of node B:

  • If the code of node A is EntryApi_3909f, and the location of input parameter userId is Path, set the expression for obtaining the request parameter value of node A as follows:

    ${EntryApi_3909f|userId}

  • If the code of node B is NormalApi_4246f, and the value is a two-dimensional array of multiple rows and columns, set the expression for obtaining the value in the first row and name column in the result set of node B as follows:

    ${NormalApi_4246f|payload.data[0].name}

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback