Updated on 2025-08-15 GMT+08:00

Adding a Trigger for Application Developed in the Platform

Triggers intuitively display service processes to users. Once set up, triggers automate operations without the need for manual execution by users. In the service configuration center, you can disable or enable the triggers in an application, or create a trigger.

Configuring a Trigger

  1. Log in to the Huawei Cloud Astro Zero console and click Access Homepage. The application development page is displayed.
  2. Click in the upper left corner and choose Environments > Configuration Center.
  3. Choose Application Configuration from the main menu.
  4. On the application configuration page, select an application type (for example, App) and click an application.
  5. In the navigation pane, choose Trigger Settings. The existing triggers of the application are displayed on the right.

    Click OFF in the Operation column to enable the trigger and click ON to disable the trigger.

    • After a trigger is enabled, the system automatically performs the corresponding action only when the trigger condition is met.
    • After a trigger is disabled, click in the Operation column to modify the trigger conditions and actions. Only unprotected triggers can be modified.

  6. Add a trigger.

    1. On the Triggers page, click Create, set basic information by referring to Table 1, and click Add.
      Table 1 Parameters for adding a trigger

      Parameter

      Description

      Label

      Trigger label, which is displayed only on the page.

      Value: 1–64 characters.

      Name

      Trigger name, which uniquely identifies the trigger in the system. The naming requirements are as follows:

      • The value cannot exceed 64 characters, including the prefix namespace.

        To prevent duplicate data names among different tenants, each tenant must define a unique namespace when first creating an application. A tenant can create only one namespace. After being created, the namespace cannot be modified.

      • Start with a letter and can contain only letters, digits, and underscores (_). Do not end with an underscore (_).

      Trigger Mode

      Trigger starting condition.

      • On record insert only: Start the trigger when a record is created.
      • On record update only: Start the trigger when a record is updated.
      • On record insert or update: Start the trigger when a record is created or updated.
      • When called by another trigger: Start the trigger when the process is invoked by another trigger.
      • When platform event is received: Start the trigger when the process is triggered by an event. If you select this option, you need to configure a specific event in Event.

      Apply to Object

      Associates a trigger with an object.

      Description

      Description of the trigger. You are advised to enter the function of the trigger.

      Value: 1–255 characters.

    2. On the Triggers page, click in the row that contains the new trigger.
    3. Configure a condition for the trigger. Click Add Criteria, configure the condition on the right, and click Save.
      Figure 1 Creating a condition
      Table 2 Parameters for creating a condition

      Parameter

      Description

      Criteria Name

      Condition name.

      Execution Condition

      Condition for triggering the rule.

      • When conditions are met: The branch is executed only when the specified conditions are met.
      • When condition expression is true: You can enter a condition to define the logic.
      • No conditions, execute directly: Enter the branch unconditionally.

      Set Condition

      If Execution Condition is set to When conditions are met, you need to set specific conditions. You can control the conditions for entering a trigger by setting the AND or OR relationship for the values of one or more fields specified by the object involved in the trigger.

      If the value of a field in the condition is a number, percentage, or currency amount, the value of the field does not need to contain "". For other field types, add "".

      Build Formula

      If Execution Condition is set to When condition expression is true, you need to enter the rule condition.

    4. Click Add Action, set the action to be executed after the rule conditions are met, and click Save.
      Figure 2 Creating an action
      Table 3 Action types

      Parameter

      Description

      Action Type

      Action type. The options are as follows:
      • Create a Record: Create a record.
      • Update a Record: Update a record.
      • Email Alerts: Send an alarm email.
      • Trigger: Call a sub-trigger.
      • Script: Call a script. Ensure that the script is activated.
      • Flow: Call a flow. Ensure that the flow is activated.
      • BPM: Call a BPM. Ensure that the BPM is activated.

      Action Name

      Name of the action to be added.

      Select script

      Script to be executed by the action. This parameter is displayed only when Action Type is set to Script. The parameters displayed here vary according to the action type. Set the parameters based on the site requirements.

    5. (Optional) To set multiple rules or branch actions, click Add Criteria or Add Action.
    6. On the Triggers page, click OFF in the Operation column to enable the trigger.